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