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. 
//package com.company;

import java.util.*;
import java.io.*;


public class Main {

    static class TaskA {
        void solve(Scanner sc, PrintWriter pw) throws IOException {
            int n = sc.nextInt();
            boolean[] on = new boolean[1001];
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = sc.nextInt();
            }
            List<Integer> b = new ArrayList<>();
            for (int i = n - 1; i >= 0; i--) {
                if (on[a[i]]) continue;
                on[a[i]] = true;
                b.add(a[i]);
            }
            pw.println(b.size());
            Collections.reverse(b);
            for (int x: b) {
                pw.print(x);
                pw.print(" ");
            }
            pw.println();
        }
    }

    static class TaskB {
        void solve(Scanner sc, PrintWriter pw) throws IOException {
            int a = sc.nextInt() * 10;
            int b = sc.nextInt();
            int c = sc.nextInt();
            boolean[] filled = new boolean[10 * b];
            int atDigit = 1;
            while (true) {
                if (filled[a]) {
                    pw.println(-1);
                    return;
                }
                filled[a] = true;
                int remainder = a / b;
                a = a - remainder * b;
                if (remainder == c) {
                    pw.println(atDigit);
                    return;
                } else {
                    a = a * 10;
                    atDigit++;
                }
            }
        }
    }

    static class TaskC {
        double getTime(int[][] x, double target) {
            double maxTime = 0.0;
            for (int i = 0; i < x.length; i++) {
                double time = Math.abs(x[i][0] - target + 0.0) / x[i][1];
                maxTime = Math.max(maxTime, time);
            }
            return maxTime;
        }
        void solve(Scanner sc, PrintWriter pw) throws IOException {
            int n = sc.nextInt();
            int[][] x = new int[n][2];
            for (int i = 0; i < n; i++) {
                x[i][0] = sc.nextInt();
            }
            for (int i = 0; i < n; i++) {
                x[i][1] = sc.nextInt();
            }

            double lo = 0.0, hi = 1e9;
            while (lo < hi - 1e-9) {
                double x1 = (2 * lo + hi) / 3;
                double x2 = (lo + 2 * hi) / 3;
                double t1 = getTime(x, x1);
                double t2 = getTime(x, x2);
                if (t1 < t2) {
                    hi = x2;
                } else {
                    lo = x1;
                }
            }
            double time = getTime(x, (lo + hi) / 2);
            pw.println(time);
        }
    }

    static class TaskD {
        void solve(Scanner sc, PrintWriter pw) throws IOException {
            int n = sc.nextInt();
            int k = sc.nextInt();
            int even = 0, odd = 0;
            for (int i = 0; i < n; i++) {
                if (sc.nextInt() % 2 == 0) {
                    even++;
                } else {
                    odd++;
                }
            }
            // at the last round, if any of the two moves, and both odd and even exists, that person wins.
            // therefore, if Stannis is the last to move, Daenerys will try to burn all odds if k % 2 == 1. otherwise argmin(even, odd)
            // if Daenerys is the last to move, Stannis will try to burn all even
            if (n % 2 != k % 2) { // Stannis last
                int removes = (n - k) / 2;
                if (k % 2 == 1) { // => n is even
                    if (odd <= removes) {
                        pw.println("Daenerys");
                    } else {
                        pw.println("Stannis");
                    }
                } else { // => n is odd
                    if (Math.min(even, odd) <= removes) {
                        pw.println("Daenerys");
                    } else {
                        pw.println("Stannis");
                    }
                }
            } else {
                int removes = (n - k) / 2;
                if (even <= removes) {
                    if (k % 2 == 0) {
                        pw.println("Daenerys");
                    } else {
                        pw.println("Stannis");
                    }
                } else {
                    pw.println("Daenerys");
                }
            }
        }
    }

//    static class TaskE {
//        static class Fraction {
//            long a, b;
//
//            public Fraction(long a, long b) {
//                this.a = a;
//                this.b = b;
//            }
//
//            public long _gcd(long a, long b) {
//
//            }
//        }
//        void solve(Scanner sc, PrintWriter pw) throws IOException {
//
//        }
//    }

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(new BufferedOutputStream(System.out));
        (new TaskB()).solve(sc, pw);
        pw.close();
    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s){  br = new BufferedReader(new InputStreamReader(s));}

        public Scanner(FileReader s) throws FileNotFoundException {br = new BufferedReader(s);}

        public String next() throws IOException
        {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

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

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

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

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

        public boolean ready() throws IOException {return br.ready();}
    }
}

				 				 	  	   			   	 			  	