#include<iostream>
#include<cmath>
using namespace std;
int calc(int n){
	int s=0;
	while(n){
		s += n%10;
		n /= 10;
	}
	return s;
}
int main(){
	int a,b,n;
	while(cin>>a>>b>>n){
		cout<<calc((int)((a%b)/(double)b*pow(10,n)))<<endl;
	}
	return 0;
}