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. 
import java.io.*;
import java.util.*;
import java.math.*;

public class Question {
	
	String input = "";
	InputStream in;
	PrintWriter out;
	
	void solve() {
		
		int a = in_i();
		int b = in_i();
		int c = in_i();
		
		a = a % b;
		
		double x = a;
		double y = b;
		
		BigDecimal aa = new BigDecimal(String.valueOf(x));
		BigDecimal bb = new BigDecimal(String.valueOf(y));
		
		BigDecimal div = aa.divide(bb, 100000, RoundingMode.DOWN);
	
		String st = div.toString();
		len = st.length();
		int res = -1;
		
		for(int i = 2 ; i < len ; ++i) {
			if(st.charAt(i) - '0' == c) {
				res = i - 1;
				break;
			}	
		}
		out.println(res);
				
	}
	
	public static void main(String[] args) throws Exception {
		new Question().run();
	}
	
	void run() throws Exception
	{
		out = new PrintWriter(System.out);
		in = input.isEmpty() ? System.in : new ByteArrayInputStream(input.getBytes());
		long start = System.currentTimeMillis();
		solve();
		out.flush();
		if(!input.isEmpty())
			printlast(System.currentTimeMillis()-start+"ms");
	}
	
	private byte[] buffer = new byte[1024];
	public int ptr=0,len=0;
	
	private int readByte()  // input 
	{
		if(len == -1)throw new InputMismatchException();
		if(ptr >= len){
			ptr = 0;
			try { 
				len = in.read(buffer); 
			} catch (IOException e) { throw new InputMismatchException(); }
			if(len <= 0)
				return -1;
		}
		return buffer[ptr++];
	}
	
	private boolean isSpace(int c) {   // check for white space 
		return !(c > 32 && c < 127); 
	}
	
	private int check() { 
		int n; 
		while((n = readByte()) != -1 && isSpace(n)); 
		return n;
	}
	
	private double in_d() { 	// input for double
		return Double.parseDouble(in_s());
	}
	
	private char in_c() {     // input for char
		return (char)check();
	}
	
	private String in_s()  // input for one word
	{
		int n=check();
		StringBuilder st = new StringBuilder();
		while(!(isSpace(n)))  { 
			st.appendCodePoint(n);
			n=readByte();
		}
		return st.toString();
	}
	
	private String in_sl()  // input for one line
	{
		int n=check();
		StringBuilder st = new StringBuilder();
		while(!(isSpace(n) && n!=' ')) {
			st.appendCodePoint(n);
			n=readByte();
		}
		return st.toString();
	}
	
	
	private char[] in_s(int n)  // input for char array
	{
		char[] arr = new char[n];
		int a=check();
		int count=0;
		while(count < n && !(isSpace(a))){
			arr[count++]=(char)a;
			a=readByte();
		}
		return n == count ? arr : Arrays.copyOf(arr,count);
	}
	private char[][] in_ac(int n, int m)  // input for char 2D array
	{
		char[][] arr = new char[n][];
		for(int i=0 ; i<n ; i++)
			arr[i] = in_s(m);
		return arr;
	}
	private int[] in_ai(int n)  // input for int array
	{
		int[] arr = new int[n];
		for(int i = 0;i < n;i++)
			arr[i] = in_i();
		return arr;
	}
	private int in_i() // input for int
	{
		int num = 0, a;
		boolean minus = false;
		while((a = readByte()) != -1 && !((a >= '0' && a <= '9') || a == '-'));
		if(a == '-'){
			minus = true;
			a = readByte();
		}
		
		while(true){
			if(a >= '0' && a <= '9'){
				num = num*10 + (a-'0');
			}else{
				return minus ? -num : num;
			}
			a = readByte();
		}
	}
	
	private long in_l() // input for long
	{
		long num = 0;
		int a;
		boolean minus = false;
		while((a = readByte()) != -1 && !(( a >= '0' && a <= '9') || a == '-'));
		if(a == '-'){
			minus = true;
			a = readByte();
		}
		
		while(true){
			if(a >= '0' && a <= '9'){
				num = num * 10 + (a - '0');
			}else{
				return minus ? -num : num;
			}
			a = readByte();
		}
	}
	
	private void printlast(Object... o) { 
		if(input.length() > 0)
			System.out.println(Arrays.deepToString(o)); 
	}
}
	
	