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.*;

public class B {

    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;

    public static void main(String[] args) throws IOException {
        try {
            in = new BufferedReader(new FileReader("input.txt"), 65536);
            out = new PrintWriter(new BufferedWriter(new FileWriter("output.txt"),65536));
        } catch (Exception e) {
            in = new BufferedReader(new InputStreamReader(System.in),32768);
            out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out),65536));
        }
        tok = new StringTokenizer("");
        new B().solve();
        out.flush();
        out.close();
    }


    String nextTok() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    String nextLine() throws IOException {
        return in.readLine();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextTok());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextTok());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextTok());
    }

    class Pair implements Comparable<Pair>{
        int a;
        int b;
        Pair(int a, int b) {
            this.a = a;
            this.b = b;
        }

        @Override
        public int compareTo(Pair o) {
            if (a != o.a) return Integer.compare(a,o.a);
            return Integer.compare(b,o.b);
        }
    }
    
    void solve() throws IOException {
        int a = nextInt();
        int b = nextInt();
        int c = nextInt();
        int k = (a%b)*10;
        
        for (int i = 1; i <= 100010; i++) {
            int cur = 0;
            if (k < b) {
                k *= 10;
            } else {
                cur = k/b;
                k = (k%b)*10;
            }
            if (cur == c) {
                out.println(i);
                return;
            }
        }
        out.println(-1);
    }

}