#include <bits/stdc++.h>
using namespace std;
void solve() {
  int a, b, c;
  int count = 1;
  cin >> a >> b >> c;
  if (c % a == 0) {
    count++;
  }
  if (c % b == 0) {
    count++;
  }
  cout << count << endl;
}
int main() {
  solve();
  return 0;
}
