#include <bits/stdc++.h>
int main() {
  int m, n, z, i, ans;
  while (scanf("%d %d %d", &n, &m, &z) != EOF) {
    ans = 0;
    for (i = 1; i <= z; i++) {
      if (i % n == 0 && i % m == 0) ans++;
    }
    printf("%d\n", ans);
  }
  return 0;
}
