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