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.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;


import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.Random;
import java.util.TreeSet;


public final class CF_450_B{

	static boolean verb=true;
	static void log(Object X){if (verb) System.err.println(X);}
	static void log(Object[] X){if (verb) {for (Object U:X) System.err.print(U+" ");System.err.println("");}}
	static void log(int[] X){if (verb) {for (int U:X) System.err.print(U+" ");System.err.println("");}}
	static void log(long[] X){if (verb) {for (long U:X) System.err.print(U+" ");System.err.println("");}}

	static void logWln(Object X){if (verb) System.err.print(X);}
	static void info(Object o){	System.out.println(o);}
	static void output(Object o){outputWln(""+o+"\n");	}
	static void outputWln(Object o){try {out.write(""+ o);} catch (Exception e) {}}



	static long mod=1000000007;


	// Global vars
	static BufferedWriter out;
	static InputReader reader;

	static int mx=10000;


	static int solveBC(int a,int b,int c){
		a=a%b;
		char cc=(char)('0'+c);
		BigDecimal A=new BigDecimal(a);
		BigDecimal B=new BigDecimal(b);
		BigDecimal D=A.divide(B,mx,RoundingMode.HALF_UP);
		String s=""+D;
		int ans=-1;
		for (int i=2;i<s.length();i++){
			if (s.charAt(i)==cc){
				ans=i+1;
				break;
			}
		}
		return ans;
	}


	static int solve(int a,int b,int c){
		double d=a%b;
		log(String.format("%4f",d/b));
		char cc=(char)('0'+c);
		int MX=10000001;
		boolean[] mem=new boolean[MX];

		int ans=-1;
		a%=b;
		if (a==0){
			if (c==0)
				ans=1;
		} else {

			int cnt=1;
			loop:while (true){
				a*=10;
				int x=a/b;
				log(x);
				if (x==c){
					ans=cnt;
					break loop;
				}
				a%=b;
				if (mem[a])
					break loop;
				mem[a]=true;
				cnt++;
			}
		}

		return ans;

	}

	static void test(){
		log("testing");
		for (int a=1;a<100;a++)
			for (int b=1;b<100;b++)
				for (int c=1;c<10;c++){
					int x=solve(a,b,c);
					int y=bourrin(a,b,c);
					if (x!=y){
						log("Error");
						log(a+" "+b+" "+c );
						log(x);
						log(y);
						return;

					}
				}
		log("done");
	}

	static int bourrin(int a,int b,int c){
		double x=a%b;
		x/=b;

		String s=""+x;

		int ans=-1;
		char cc=(char)('0'+c);

		for (int i=0;i<s.length();i++){
			if (s.charAt(i)==cc){
				ans=i-1;
				break;
			}
		}
		return ans;
	}



	static void process() throws Exception {


		out = new BufferedWriter(new OutputStreamWriter(System.out));
		reader=new InputReader(System.in);




		//test();

		int a=reader.readInt();
		int b=reader.readInt();
		int c=reader.readInt();

		output(solve(a,b,c));


		try {
			out.close();
		}
		catch (Exception e){}


	}


	public static void main(String[] args) throws Exception {
		process();

	}

	static final class InputReader {
		private final InputStream stream;
		private final byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		private int read() throws IOException {
			if (curChar >= numChars) {
				curChar = 0;
				numChars = stream.read(buf);
				if (numChars <= 0) {
					return -1;
				}
			}
			return buf[curChar++];
		}


		public final String readString() throws IOException {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			StringBuilder res=new StringBuilder();
			do {
				res.append((char)c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public final int readInt() throws IOException {
			int c = read();
			boolean neg=false;
			while (isSpaceChar(c)) {
				c = read();
			}
			char d=(char)c;
			//log("d:"+d);
			if (d=='-') {
				neg=true;
				c = read();
			}
			int res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			//log("res:"+res);
			if (neg)
				return -res;
			return res;

		}

		public final long readLong() throws IOException {
			int c = read();
			boolean neg=false;
			while (isSpaceChar(c)) {
				c = read();
			}
			char d=(char)c;
			//log("d:"+d);
			if (d=='-') {
				neg=true;
				c = read();
			}
			long res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			//log("res:"+res);
			if (neg)
				return -res;
			return res;

		}




		private boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
	}


}