#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, z;
  cin >> n >> m >> z;
  int t = min(n, m);
  int t2 = max(n, m);
  int ans = 0;
  for (int i = t; i <= z; i += t) {
    if (i % t2 == 0) ans++;
  }
  cout << ans << "\n";
}
