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 const delta = 1000000007;
int main() {
  std::ios::sync_with_stdio(0);
  ;
  cin.tie(0);
  cout.tie(0);
  long long a, b, c;
  cin >> a >> b >> c;
  long long mark = 0, num = 0, temp = 0;
  long long i = 0, m = 0, last = 0;
  long long nums[10];
  fill(nums, nums + 10, 0);
  while (1) {
    if (a < b) a *= 10;
    temp += (a / b);
    a %= b;
    if (i > 0) last = (((temp % 100) - (temp % 10)) / 10);
    if (temp % 10 == c) {
      m = 1;
      break;
    }
    if (last == (temp % 10)) {
      mark++;
      if (mark >= 5) break;
    } else
      mark = 0;
    nums[(temp % 10)]++;
    if (nums[temp % 10] >= 10000) break;
    temp *= 10;
    stringstream ss;
    ss << temp;
    if (ss.str().size() > 5) {
      long long t = temp % 1000;
      temp = 0;
      temp += 1000;
    }
    i++;
  }
  if (m)
    cout << i + 1;
  else
    cout << -1;
  return 0;
}
