You have a fraction <image>. You need to find the first occurrence of digit c into decimal notation of the fraction after decimal point.

Input

The first contains three single positive integers a, b, c (1 ≤ a < b ≤ 105, 0 ≤ c ≤ 9).

Output

Print position of the first occurrence of digit c into the fraction. Positions are numbered from 1 after decimal point. It there is no such position, print -1.

Examples

Input

1 2 0


Output

2

Input

2 3 7


Output

-1

Note

The fraction in the first example has the following decimal notation: <image>. The first zero stands on second position.

The fraction in the second example has the following decimal notation: <image>. There is no digit 7 in decimal notation of the fraction. 
/**
 * DA-IICT
 * Author : Savaliya Sagar
 */
import java.io.*;
import java.math.*;
import java.util.*;


public class B900 {
	void solve() {
		int a = ni();
		int b = ni();
		int c = ni();
		HashSet<Integer> h = new HashSet<>();
		int p = 1;
		while(true) {
			int cnt = 0;
			a *= 10;
			while(a<b) {
				a *= 10;
				cnt++;
			}
			tr(p,cnt);
			if(cnt>0 && c==0){	out.println(p);  return; }
			p += cnt;
			int d = a/b;
			if(d==c) { out.println(p);	return;	}
			p++;
			a = a%b;
			if(a==0 && c==0) {
				out.println(p);
				return;
			}else if(a==0) {
				out.println(-1);
				return;
			}
			if(!h.add(a)) {
				out.print(-1);
				return;
			}
		}
	}

	void run() throws Exception {
		out = new PrintWriter(System.out);
		reader = new BufferedReader(new InputStreamReader(System.in), 32768);
		tokenizer = null;
		solve();
		out.flush();
	}

	BufferedReader reader;
	StringTokenizer tokenizer;
	PrintWriter out;

	public static void main(String[] args) throws Exception {
		new B900().run();
	}
	public int ni() {
		return Integer.parseInt(next());
	}
	public String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}
	private void tr(Object... o) {
		if (debug == 1)
			System.out.println(Arrays.deepToString(o));
	}

	int debug = 0;
}
