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