//This is the solution to http://codeforces.com/contest/900/problem/B
//B. Position in Fraction
#raw "template.cpy"

int main()
	int a, b, c
	cin a b c
	dec = 0
	while dec++ <= b
		div = 0
		res = 0
		
		a *= 10
		
		while a > res
			res += b
			div++
		if a < res
			res -= b
			div--
		
		pa = a
		a -= res
		//? pa a div dec
		
		if div%10 == c
			! dec
			return 0
			
	
	! -1