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. 

/**
 * @author: Mehul Raheja
 */
import java.util.*;
import java.io.*;

public class B {

    /*
        Runtime = O()
     */
    static int N, M, K;
    static String s;
    static StringTokenizer st;
    static int[] d;

    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        st = new StringTokenizer(br.readLine());
        int A = Integer.parseInt(st.nextToken());
        int B = Integer.parseInt(st.nextToken());
        int C = Integer.parseInt(st.nextToken());
        char f = Integer.toString(C).charAt(0);

        
        
        A %= B;
        int r = A%B;
        for (int i = 1; i < 100000; i++) {
            int cur = (r*10)/B;
            r = (r*10)%B;
            if(cur == C){
                System.out.println(i);
                System.exit(0);
            }
        }
        System.out.println(-1);

//        String s = Double.toString(cur);
//        int p = -(1 << 30);
//        for (int i = 0; i < s.length(); i++, p++) {
//            if (s.charAt(i) == '.') {
//                p = 0;
//            }
//            if (p > 0 && s.charAt(i) == f) {
//                System.out.println(p);
//                System.exit(0);
//            }
//        }
//        if (f == '0') {
//            System.out.println(p);
//        } else {
//            System.out.println(-1);
//        }
    }
}
