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