#include <bits/stdc++.h>
using namespace std;
int main() {
  long a, b, c, lc, max;
  cin >> a >> b >> c;
  max = (a > b) ? a : b;
  do {
    if (max % a == 0 && max % b == 0) {
      cout << c / max << endl;
      break;
    } else
      ++max;
  } while (true);
  return 0;
}
