#include <bits/stdc++.h>
using namespace std;
int main() {
  int inc = 1;
  int a, b, c;
  int ret = 0;
  cin >> a >> b >> c;
  while (true) {
    if ((b + 1) < inc) {
      break;
    }
    if (a % inc == 0 || b % inc == 0) {
      if (c % inc == 0) {
        ret++;
      }
    }
    inc++;
  }
  cout << ret << endl;
}
