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. 
// createe date: 2017/12/12
// finish date:

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class Main{
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    static int[] inputval() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    static void array_sout(int[][] array) {
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[0].length; j++) {
                System.out.print(array[i][j] + " ");
            }
            System.out.println();
        }
    }

    static void array_sout(int[] array) {
        for (int i = 0; i < array.length; i++) {
            System.out.print(array[i] + " ");
        }
        System.out.println();
    }

    public static void main(String[] args) throws Exception {
        int[] val = inputval();
        int a,b,goal;
        a = val[0]*10;
        b = val[1];
        goal = val[2];
        ArrayList<Integer> x = new ArrayList<>();
        ArrayList<Integer> y = new ArrayList<>();
        int amari;
        int syou;
        int digit=1;
        while(true){
            if(a == 0){
                if(goal==0){
                    System.out.println(digit);
                }else{
                    System.out.println(-1);
                }
                break;
            }
            while(a < b) {
                if(goal == 0){
                    System.out.println(digit);
                    return;
                }
                digit++;
                a*=10;
            }
            while(b*10 < a) b*=10;
            while(a%10==0 && b%10==0){
                a/=10;
                b/=10;
            }
            syou = a/b;
            amari = a%b;
            if(syou == goal) {
                System.out.println(digit);
                break;
            }
            a = amari*10;
            for(int i=0; i<x.size(); i++){
                if(syou==x.get(i) && amari==y.get(i)){
                    System.out.println(-1);
                    return;
                }
            }
            x.add(syou);
            y.add(amari);
            digit++;
        }
    }
}