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

public class Main implements Runnable {

    int maxn = (int)1e5+111;
    int mod = (int)1e9+7;
    int inf = (int)1e9;
    int n,m,k,x;
    int a[] = new int[maxn];
    int right[] = new int[maxn];
    int left[] = new int[maxn];

    void solve() throws Exception {


        int a = in.nextInt();
        int b = in.nextInt();
        int c = in.nextInt();
        int pos = 0;

        for (int j=0; j<1000000; j++) {
            StringBuilder zero = new StringBuilder();
            while (a!=0 && a<b) {
                a*=10;
                zero.append("0");
            }
            int mult = a/b;
            a%=b;
            if (!zero.toString().isEmpty()) {
                zero.deleteCharAt(zero.length()-1);
            }
            String strMult = zero+String.valueOf(mult);
            for (int i=0; i<strMult.length(); i++) {
                pos++;
                int val = strMult.charAt(i) - '0';
                if (val==c) {
                    out.println(pos);
                    return;
                }
            }
        }
        // 2345 9345 0.2509363296
        out.println(-1);
    // 3 12342 0.0002430724356
    }

    public class SegmentTree {

        private SegmentTree leftNode;
        private SegmentTree rightNode;
        private int value;
        private int leftBound, rightBound;
        private int pushValue;

        public SegmentTree(int arr[], int leftBound, int rightBound) {
            this.leftBound = leftBound;
            this.rightBound = rightBound;
            pushValue = 0;
            if (leftBound == rightBound) {
                value = arr[leftBound];
                return;
            }
            int mid = (leftBound + rightBound) / 2;
            leftNode = new SegmentTree(arr, leftBound, mid);
            rightNode = new SegmentTree(arr, mid + 1, rightBound);
            value = rangeValue();
        }

        public int getRangeValue(int l, int r) {
            if (rightBound < l || leftBound > r) return 0;
            if (l <= leftBound && rightBound <= r) return value;
            return Math.max(leftNode.getRangeValue(l, r) , rightNode.getRangeValue(l, r));
        }

        public void update(int pos, int val) {
            if (leftBound == rightBound) {
                value = val;
                return;
            }

            int mid = (leftBound + rightBound) / 2;

            if (pos <= mid) leftNode.update(pos, val);
            else rightNode.update(pos, val);

            value = rangeValue();
        }


        private int getValue() {
            return value;
        }


        public int rangeValue() {
            return leftNode.getValue() + rightNode.getValue();
        }
    }

    class Pair {
        int x;
        int y;
        public Pair (int x, int y) {
            this.x = x;
            this.y = y;

        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;

            Pair pair = (Pair) o;

            if (x != pair.x) return false;
            return y == pair.y;
        }

        @Override
        public int hashCode() {
            int result = x;
            result = 31 * result + y;
            return result;
        }
    }


    String fileInName = "input.txt";
    boolean file = false;
    boolean isAcmp = true;

    static Throwable throwable;
    public static void main (String [] args) throws Throwable {
        Thread thread = new Thread(null, new Main(), "", (1 << 26));
        thread.start();
        thread.join();
        thread.run();
        if (throwable != null)
            throw throwable;
    }

    FastReader in;
    PrintWriter out;

    public void run() {
        String fileIn = "input.txt";
        String fileOut = "output.txt";

        try {
            if (isAcmp) {
                if (file) {
                    in = new FastReader(new BufferedReader(new FileReader(fileIn)));
                    out = new PrintWriter (fileOut);
                } else {
                    in = new FastReader(new BufferedReader(new InputStreamReader(System.in)));
                    out = new PrintWriter(System.out);
                }
            } else if (file) {
                in = new FastReader(new BufferedReader(new FileReader(fileInName+".in")));
                out = new PrintWriter (fileInName + ".out");
            } else {
                in = new FastReader(new BufferedReader(new InputStreamReader(System.in)));
                out = new PrintWriter(System.out);
            }

            solve();
        } catch(Exception e) {
            throwable = e;
        } finally {
            out.close();
        }

    }
}

class FastReader {
    BufferedReader bf;
    StringTokenizer tk = null;

    public FastReader(BufferedReader bf) {
        this.bf = bf;
    }

    public String nextToken () throws Exception {
        if (tk==null || !tk.hasMoreTokens()) {
            tk = new StringTokenizer(bf.readLine());
        }
        if (!tk.hasMoreTokens()) return nextToken();
        else
            return tk.nextToken();
    }

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

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

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