#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
using namespace std;
int main()
{
	int a, b, n, i, r;
	double x, y, t;
	char s[256], c;
	while (cin >> a >> b >> n)
	{
		x = (double)a / b;
		y = modf(x, &t);
		sprintf(s, "%.32lf", y);
		r = 0;
		for (i = 2; i < n+2; i++)
		{
			c = s[i];
			r += atoi(&c);
		}
		cout << r << endl;
	}
}