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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;


public class LongDiv {

    private static BufferedReader br ;
    private static StringTokenizer st ;

    LongDiv()
    {
        br = new BufferedReader(new InputStreamReader(System.in));
    }
    
    public static String next()
    {
        while(st==null || !st.hasMoreElements())
        {
            try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                }
        }
        return st.nextToken();
    }

    public int nextInt()
    {   
        return Integer.parseInt(next());
    }

    public Long nextLong()
    {   
        return Long.parseLong(next());
    }

    public Double nextDouble()
    {   
        return Double.parseDouble(next());
    }

    public String nextLine() 
    { 
        String str = ""; 
        try
        { 
            str = br.readLine(); 
        } 
        catch (IOException e) 
        { 
            e.printStackTrace(); 
        } 
        return str; 
    } 

    public static String longDiv(int a , int b)
    {   
        StringBuilder sb = new StringBuilder();
        int times = b;
        boolean bo = false;
        int pos = 0;
        while(a!=0&&times>0)
        {   
            int x = (a/b);
            if(x>1)
            {
                a = a - (a/b)*b;
                sb.append(x);
            }
            else if(x<1&&!bo)
            {
                a = a*10;
                bo = true;
                sb.append(".");
                x = (a/b);
                a = a - (a/b)*b;
                sb.append(x);
            }
            else
            {
                a = a*10;
                x = (a/b);
                a = a - (a/b)*b;
                sb.append(x);
            }
            times = times - 1;
        }
        return sb.toString();
    }

    public static void main(String[] args) {
        LongDiv obj = new LongDiv();
        int a = obj.nextInt();
        int b = obj.nextInt();
        int c = obj.nextInt();   
        
    String arr[] = longDiv(a, b).split("\\.");
    char c1 = Integer.toString(c).charAt(0);
    if(c1=='0')
    {
        if(arr[1].indexOf(c1)>=0)
        System.out.println(arr[1].indexOf(c1)+1);
        else if(arr[1].length()>=b)
        System.out.println("-1");
        else
        System.out.println(arr[1].length()+1);
    }
    else
    {
        if(arr[1].indexOf(c1)>=0)
        System.out.println(arr[1].indexOf(c1)+1);
        else
        System.out.println("-1");
    }
}   
}