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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.RoundingMode;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Washoum
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        inputClass in = new inputClass(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DPositionInFraction solver = new DPositionInFraction();
        solver.solve(1, in, out);
        out.close();
    }

    static class DPositionInFraction {
        int gcd(int a, int b) {
            return (a % b == 0) ? b : gcd(b, a % b);
        }

        public void solve(int testNumber, inputClass sc, PrintWriter out) {
            int u = sc.nextInt();
            int v = sc.nextInt();
            int g = gcd(u, v);
            u /= g;
            v /= g;
            BigDecimal a = new BigDecimal(u);
            BigDecimal b = new BigDecimal(v);
            int c = sc.nextInt();
            String s = String.valueOf(a.setScale(200000, RoundingMode.DOWN).divide(b, RoundingMode.DOWN));
            boolean after = false;
            int ans = 1;
            for (int i = 0; i < s.length(); i++) {
                if (!after) {
                    if (s.charAt(i) == '.') {
                        after = true;
                    }
                } else {
                    if (s.charAt(i) - '0' == c) {
                        out.println(ans);
                        return;
                    } else {
                        ans++;
                    }
                }
            }
            out.println(-1);

        }

    }

    static class inputClass {
        BufferedReader br;
        StringTokenizer st;

        public inputClass(InputStream in) {

            br = new BufferedReader(new InputStreamReader(in));
        }

        public 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());
        }

    }
}

