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