Appeal from a judgment of the County Court of Saratoga County (Scarano, J.), rendered May 10, 2013, convicting defendant upon his plea of guilty of the crime of attempted criminal sale of a controlled substance in the third degree.
Defendant was charged in a three-count indictment with various drug-related crimes as the result of his sale of cocaine to an *1010individual in the Town of Halfmoon, Saratoga County. Similar charges were also filed against defendant in Rensselaer County in connection with other drug sales. In satisfaction of the indictment, defendant pleaded guilty to attempted criminal sale of a controlled substance in the third degree and waived his right to appeal. Under the terms of the plea agreement, defendant was to be sentenced as a second felony offender to four years in prison, to be followed by a period of postrelease supervision ranging from IV2 to 3 years. The sentence was to run concurrently to the sentence imposed by Rensselear County Court in connection with the charges pending there. Defendant was sentenced in accordance with the plea agreement and a three-year period of postrelease supervision was imposed. He now appeals.
Initially, contrary to defendant’s claim, we find that defendant entered a valid waiver of the right to appeal. Although County Court ambiguously stated that the waiver forfeited defendant’s right to appeal “either the plea or sentence,” the written waiver, which defendant executed in open court, clarified that it encompassed the plea as well as the sentence and defendant indicated that he had discussed it with counsel and understood the consequences of the waiver (see People v Fling, 112 AD3d 1001, 1002 [2013], lv denied 23 NY3d 1020 [2014]). Moreover, County Court properly advised defendant that his waiver of the right to appeal was separate and distinct from the other rights that he was forfeiting by pleading guilty (see People v Lopez, 6 NY3d 248, 256 [2006]; People v Fate, 117 AD3d 1327, 1328 [2014]). Accordingly, under the circumstances presented, we find that the waiver was knowing, voluntary and intelligent (see People v Lopez, 6 NY3d at 256; People v Fligger, 117 AD3d 1343, 1344 [2014], lv denied 23 NY3d 1061 [2014]).
Defendant maintains that County Court failed to comply with an important condition of the plea agreement, which was that his sentence include a provision that he serve time in the Willard drug treatment program just as Rensselear County Court had directed as part of the sentence it imposed. Based upon this, he argues that his guilty plea was not voluntary. Although defendant’s waiver of his right to appeal does not preclude him from challenging the voluntariness of his guilty plea, he has failed to preserve this claim for review by making an appropriate postallocution motion or by objecting at the sentencing (see People v Tole, 119 AD3d 982, 983 [2014]; People v Fate, 117 AD3d at 1328; People v Haynes, 14 AD3d 789, 790-791 [2005], lv denied 4 NY3d 831 [2005]). In any event, there is no support in the record for defendant’s assertion that the plea agreement *1011implicitly included a provision that, upon his incarceration, defendant would participate in the Willard drug treatment program. To the contrary, County Court specifically made it clear that this was not a component of the sentence, a point expressly acknowledged by defense counsel. Lastly, defendant’s challenge to the severity of the sentence is precluded by his valid waiver of the right to appeal (see People v Fligger, 117 AD3d at 1344; People v Fling, 112 AD3d at 1002).
Stein, J.E, Garry, Rose and Devine, JJ., concur.Ordered that the judgment is affirmed.