#include <bits/stdc++.h>
using namespace std;
int lcm(int a, int b) {
  if (a < b) {
    int temp = a;
    a = b;
    b = temp;
  }
  int c = 1;
  while (c) {
    if (((c * a) % b) == 0) {
      return c * a;
    }
    c++;
  }
}
int main() {
  int n, m, z;
  cin >> n >> m >> z;
  cout << (z / (lcm(n, m)));
  return 0;
}
