#include <bits/stdc++.h>
using namespace std;
int n, d, a[1000009], h[1000009], c, tot = 0;
bool b[1000009];
int main() {
  scanf("%d%d%d", &n, &d, &c);
  int rt = n / d;
  if (rt == 0) tot = 1;
  while (rt) tot++, rt = rt / 10;
  tot++;
  int j = 0, i = 0;
  n = n % d;
  while (n) {
    i++;
    if (!b[n]) {
      b[n] = true;
      h[n] = i;
    } else {
      j = h[n];
      break;
    }
    n = n * 10;
    a[i] = n / d;
    n = n % d;
  }
  int m = i, fl = 0;
  if (c == 0) {
    if (m - j)
      for (i = 1; i < m; i++) {
        if (a[i] == 0) {
          printf("%d\n", i);
          fl = 1;
          break;
        }
      }
    if (fl == 0) {
      if (j == 0)
        printf("%d\n", m + 1);
      else
        printf("-1\n");
    }
  } else {
    for (i = 1; i <= m; i++) {
      if (a[i] == c) {
        printf("%d\n", i);
        fl = 1;
        break;
      }
    }
    if (fl == 0) printf("-1\n");
  }
  return 0;
}
