#include <stdio.h>

int main() {
    long long num = 0;
    scanf("%lld",&num);
    long long i = 10;
    long long result = 0;
    while (num % (i/10) != num)
    {
        result += (num % i - result) / (i/10) ;
        i *= 10;
    }

    printf("%lld\n",result);
    return 0;
}