#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
using namespace std;

const int MaxNL = 500000;

char s[MaxNL + 2];

struct bigNum
{
	int l, w;
	int a[MaxNL + 3];

	inline void read()
	{
		scanf("%s", s + 1);
		l = strlen(s + 1);
		reverse(s + 1, s + l + 1);

		for (int i = 1; i <= l; ++i)
			a[i] = s[i] - '0';

		int t = w = 0;
		for (int i = 1; i <= l; ++i)
		{
			t += a[i] * 9;
			w += (a[i] = t % 10);
			if ((t /= 10) > 0 && i == l)
				++l;
		}
	}

	inline void operator+=(const int &v)
	{
		int t = v;
		for (int i = 1; t && i <= l; ++i)
		{
			w -= a[i], t += a[i];
			w += (a[i] = t % 10);
			if ((t /= 10) > 0 && i == l)
				++l;
		}
	}
};
bigNum cur;

int main()
{
	cur.read();

	for (int k = 1; ; ++k)
	{
		cur += 9;
		if (cur.w <= 9 * k)
		{
			cout << k << endl;
			break;
		}
	}

	return 0;
}