#include <bits/stdc++.h>
using namespace std;
int main() {
  int q, w, e, i, a = 0, b = 0;
  cin >> q >> w >> e;
  for (i = 1; i <= e; i++) {
    if (i % q == 0 && i % w == 0) {
      a++;
    }
  }
  cout << a << endl;
}
