#include <bits/stdc++.h>
int main() {
  int x, y, z, i, j, n = 0;
  scanf("%d", &x);
  scanf("%d", &y);
  ;
  scanf("%d", &z);
  for (i = x; i <= z; i = i + x) {
    for (j = y; j <= z; j = j + y) {
      if (i == j) n = n + 1;
    }
  }
  printf("%d", n);
  return 0;
}
