#include <bits/stdc++.h>
using namespace std;
int LCM(int a, int b) {
  int lcm;
  if (a > b)
    lcm = a;
  else
    lcm = b;
  while (1) {
    if (lcm % a == 0 && lcm % b == 0) {
      return lcm;
      break;
    }
    lcm++;
  }
}
int main() {
  int i, j, a, b, c, d, e;
  cin >> a >> b >> c;
  d = LCM(a, b);
  e = c / d;
  cout << e << endl;
  return 0;
}
