#include <bits/stdc++.h>
using namespace std;
class fraction {
  int a, b, c, d, k;
  bitset<100000> numerator;
  int next() {
    int p = 10 * a, q = p % b;
    numerator.set(a), d = p / b, k++;
    return q;
  }

 public:
  fraction() : k(0) { scanf("%i %i %i", &a, &b, &c); }
  int solution() {
    for (int q = next(); a != 0 && d != c; a = q, q = next())
      if (numerator[q]) return -1;
    return d == c ? k : -1;
  }
};
int main() {
  fraction problem;
  printf("%i", problem.solution());
}
