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

// public class Solution {

// 	public static void main (String[] args) throws java.lang.Exception {
// 		FastIO2 in = new FastIO2();
// 		int n= in.ni();
//         int pos =0 ;
//         int neg = 0;
//         for(int i=0;i<n;i++){
//             int x = in.ni();
//             int y = in.ni();
//             if(y>0){
//                 pos++;
//             }
//             else{
//                 neg++;
//             }
//         }
//         if(pos==1||neg==1){
//             System.out.println("Yes");
//         }
//         else{
//             System.out.println("No");
//         }
// 	}
	
// 	static class FastIO2 {

//         private final BufferedReader br;
//         private String s[];
//         private int index;

//         public FastIO2() throws IOException {
//             br = new BufferedReader(new InputStreamReader(System.in));
//             s = br.readLine().split(" ");
//             index = 0;
//         }

//         public int ni() throws IOException {
//             return Integer.parseInt(nextToken());
//         }

//         public double nd() throws IOException {
//             return Double.parseDouble(nextToken());
//         }

//         public long nl() throws IOException {
//             return Long.parseLong(nextToken());
//         }

//         public String next() throws IOException {
//             return nextToken();
//         }

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

//         public int[] gia(int n) throws IOException {
//             int a[] = new int[n];
//             for (int i = 0; i < n; i++) {
//                 a[i] = ni();
//             }
//             return a;
//         }

//         public int[] gia(int n, int start, int end) throws IOException {
//             validate(n, start, end);
//             int a[] = new int[n];
//             for (int i = start; i < end; i++) {
//                 a[i] = ni();
//             }
//             return a;
//         }

//         public double[] gda(int n) throws IOException {
//             double a[] = new double[n];
//             for (int i = 0; i < n; i++) {
//                 a[i] = nd();
//             }
//             return a;
//         }

//         public double[] gda(int n, int start, int end) throws IOException {
//             validate(n, start, end);
//             double a[] = new double[n];
//             for (int i = start; i < end; i++) {
//                 a[i] = nd();
//             }
//             return a;
//         }

//         public long[] gla(int n) throws IOException {
//             long a[] = new long[n];
//             for (int i = 0; i < n; i++) {
//                 a[i] = ni();
//             }
//             return a;
//         }

//         public long[] gla(int n, int start, int end) throws IOException {
//             validate(n, start, end);
//             long a[] = new long[n];
//             for (int i = start; i < end; i++) {
//                 a[i] = ni();
//             }
//             return a;
//         }

//         private String nextToken() throws IndexOutOfBoundsException, IOException {
//             if (index == s.length) {
//                 s = br.readLine().split(" ");
//                 index = 0;
//             }
//             return s[index++];
//         }

//         private void validate(int n, int start, int end) {
//             if (start < 0 || end >= n) {
//                 throw new IllegalArgumentException();
//             }
//         }
//     }
// }
class Solution {

 public static void main (String[] args) throws java.lang.Exception {
        FastIO2 in = new FastIO2();
        int a = in.ni();
        int b = in.ni();
        int c = in.ni();
        int mod = a%b;
        for(int i=1;i<=1000000;i++){
            if(10*mod/b==c){
                System.out.println(i);
                return;
            }
            else{
                mod = (10*mod)%b;
            }
        }
        System.out.println(-1);
 }
    
 static class FastIO2 {

        private final BufferedReader br;
        private String s[];
        private int index;

        public FastIO2() throws IOException {
            br = new BufferedReader(new InputStreamReader(System.in));
            s = br.readLine().split(" ");
            index = 0;
        }

        public int ni() throws IOException {
            return Integer.parseInt(nextToken());
        }

        public double nd() throws IOException {
            return Double.parseDouble(nextToken());
        }

        public long nl() throws IOException {
            return Long.parseLong(nextToken());
        }

        public String next() throws IOException {
            return nextToken();
        }

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

        public int[] gia(int n) throws IOException {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = ni();
            }
            return a;
        }

        public int[] gia(int n, int start, int end) throws IOException {
            validate(n, start, end);
            int a[] = new int[n];
            for (int i = start; i < end; i++) {
                a[i] = ni();
            }
            return a;
        }

        public double[] gda(int n) throws IOException {
            double a[] = new double[n];
            for (int i = 0; i < n; i++) {
                a[i] = nd();
            }
            return a;
        }

        public double[] gda(int n, int start, int end) throws IOException {
            validate(n, start, end);
            double a[] = new double[n];
            for (int i = start; i < end; i++) {
                a[i] = nd();
            }
            return a;
        }

        public long[] gla(int n) throws IOException {
            long a[] = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = ni();
            }
            return a;
        }

        public long[] gla(int n, int start, int end) throws IOException {
            validate(n, start, end);
            long a[] = new long[n];
            for (int i = start; i < end; i++) {
                a[i] = ni();
            }
            return a;
        }

        private String nextToken() throws IndexOutOfBoundsException, IOException {
            if (index == s.length) {
                s = br.readLine().split(" ");
                index = 0;
            }
            return s[index++];
        }

        private void validate(int n, int start, int end) {
            if (start < 0 || end >= n) {
                throw new IllegalArgumentException();
            }
        }
    }
}