#include <bits/stdc++.h>
using namespace std;
void init() {
  ios::sync_with_stdio(0);
  cin.tie(0);
}
void solve();
int main() {
  init();
  solve();
  return 0;
}
void solve() {
  int n, m, z;
  cin >> n >> m >> z;
  bitset<100000> a;
  bitset<100000> b;
  for (int i = 1; i <= z; i++) {
    if (i % n == 0) {
      a[i] = true;
    } else
      a[i] = false;
  }
  for (int i = 1; i <= z; i++) {
    if (i % m == 0) {
      b[i] = true;
    } else
      b[i] = false;
  }
  int ans = 0;
  for (int i = 1; i <= z; i++) {
    if (a[i] && b[i]) {
      ans++;
    }
  }
  cout << ans << "\n";
}
