#define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>

using namespace std;

typedef long long ll;
typedef pair<int,int> P;

#define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>

using namespace std;

typedef long long ll;
typedef pair<int,int> P;

ll sum(int i,ll* bit){
	int s = 0;
	while(i > 0){
		s += bit[i];
		i -= i & -i;
	}
	return s;
}

void add(int i, ll x,ll* bit,ll n){
	while(i <= n){
		bit[i] += x;
		i += i & -i;
	}	
}

int main(){

	double a,b;
	int n;
	while(~scanf("%lf %lf %d",&a,&b,&n)){

		double c = a/b;
		ll* bit = new ll[n+1]();

		c = c - (int)c;
		c*=pow(10.0,n+1);
		ll res = c;

		int idx=1;
		res/=10;
		while(res > 0){
			add(idx++,res%10,bit,n);
			res/=10;
		}

		cout << sum(n,bit) << endl;
	}
}