import java.util.*;
import java.lang.*;
import java.io.*;
class Main
{
{
long N, sum, subsidiary = 0, quantity = 0;
Scanner in
= new Scanner
(System.
in); N = in.nextLong();
while (N > 999999999) {
sum = 0;
subsidiary = N;
while (subsidiary!=0) {
sum += subsidiary%10;
subsidiary /= 10;
}
N -= sum;
quantity++;
}
if (N == 999999999) {
N = 0;
quantity += 25632473;
}
while (N > 0) {
sum = 0;
subsidiary = N;
while (subsidiary != 0) {
sum += subsidiary%10;
subsidiary /= 10;
}
N -= sum;
quantity++;
}
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBNYWluCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCWxvbmcgTiwgc3VtLCBzdWJzaWRpYXJ5ID0gMCwgcXVhbnRpdHkgPSAwOwogICAgCVNjYW5uZXIgaW4gPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwogICAgCU4gPSBpbi5uZXh0TG9uZygpOwogICAgCXdoaWxlIChOID4gOTk5OTk5OTk5KSB7CiAgICAgICAgCXN1bSA9IDA7CiAgICAgICAgCXN1YnNpZGlhcnkgPSBOOwogICAgICAgIAl3aGlsZSAoc3Vic2lkaWFyeSE9MCkgewogICAgICAgICAgICAJc3VtICs9IHN1YnNpZGlhcnklMTA7CiAgICAgICAgICAgIAlzdWJzaWRpYXJ5IC89IDEwOwogICAgICAgIAl9CiAgICAgICAgCU4gLT0gc3VtOwogICAgICAgIAlxdWFudGl0eSsrOwogICAgCX0KICAgIAlpZiAoTiA9PSA5OTk5OTk5OTkpIHsKICAgICAgICAJTiA9IDA7CiAgICAgICAgCXF1YW50aXR5ICs9IDI1NjMyNDczOwogICAgCX0KICAgIAl3aGlsZSAoTiA+IDApIHsKICAgICAgICAJc3VtID0gMDsKICAgICAgIC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