#include <bits/stdc++.h>
int main() {
  int a, b, c;
  while (scanf("%d%d%d", &a, &b, &c) != EOF) {
    int temp;
    if (a > b) {
      temp = a;
      a = b;
      b = temp;
    }
    if (a > c) {
      temp = a;
      a = c;
      c = temp;
    }
    if (b > c) {
      temp = b;
      b = c;
      c = temp;
    }
    int sum = 1;
    if (c == 0) {
      printf("0\n");
      continue;
    }
    if (((c % a) == 0) && a != b) {
      sum++;
    }
    if (((c % a) == 0) && a != b) {
      sum++;
    }
    printf("%d\n", sum);
  }
  return 0;
}
