#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, k, l, m;
  cin >> a >> b >> c;
  k = c / a;
  l = c / b;
  m = 0;
  if (l * b == c) {
    m++;
  }
  if (k * a == c) {
    m++;
  }
  cout << m << endl;
  return 0;
}
