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.math.*;
import java.util.*;
import java.lang.*;

public class Main {

    static class Task {

        void solve(int test, FastScanner in, PrintWriter out) {
            int a = in.nextInt();
            int b = in.nextInt();
            int c = in.nextInt();
            BigDecimal s = new BigDecimal(a);
            s = s.divide(new BigDecimal(b), 44445, BigDecimal.ROUND_HALF_UP);

            String q = s.toString();
            char f = Character.forDigit(c, 10);
            boolean mark = false;
            int k = -1;
            for (int i = 0; i < q.length() - 1; i++) {
                if (q.charAt(i) == '.') {
                    mark = true;
                }
                if (mark) {
                    k++;
                }
                if (q.charAt(i) == f && mark) {
                    out.println(k);
                    return;
                }
            }

            out.println("-1");
        }
    }

    public static void main(String[] args) throws IOException {
        FastScanner in = new FastScanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
//        FastScanner in = new FastScanner("arithm.in");
//        PrintWriter out = new PrintWriter(new FileWriter("arithm.out"));
        new Task().solve(1, in, out);
        out.close();
    }

    static class FastScanner {
        BufferedReader br;
        StringTokenizer token;

        public FastScanner(InputStream is) {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastScanner(String s) {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public String nextToken() {
            while (token == null || !token.hasMoreTokens()) {
                try {
                    token = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return token.nextToken();
        }

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

        public long nextLong() {
            return Long.parseLong(nextToken());
        }

        public double nextDouble() {
            return Double.parseDouble(nextToken());
        }
    }
}