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