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. 
#include <bits/stdc++.h>
using namespace std;
long long a, b, c, pw10[1000005];
long long mul(long long x, long long y, long long mod) {
  if (y == 0) return 0;
  long long tmp = mul(x, y / 2, mod) % mod;
  if (y % 2 == 0) return tmp * 2 % mod;
  return (tmp * 2 + x) % mod;
}
long long pow(long long x) {
  if (x == 0) return 1 % b;
  long long tmp = pow(x / 2) % b;
  long long res = mul(tmp, tmp, b);
  if (x % 2 != 0) res = mul(res, 10, b);
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> a >> b >> c;
  pw10[0] = 1;
  for (int i = 1; i <= 1000000; ++i) pw10[i] = pw10[i - 1] * 10 % b;
  for (int i = 1; i <= 1000000; ++i) {
    long long ans = mul(a % b, pw10[i - 1], b) * 10 / b;
    if (ans == c) {
      cout << i;
      return 0;
    }
  }
  cout << -1;
}
