#include <bits/stdc++.h>
using namespace std;
int ni() {
  int val;
  scanf("%i", &val);
  return val;
}
int64_t nll() {
  int64_t val;
  scanf("%I64d", &val);
  return val;
}
char nc() {
  char val;
  do {
    scanf("%c", &val);
  } while (val == ' ' || val == '\r' || val == '\n');
  return val;
}
char ncs() {
  char val;
  do {
    scanf("%c", &val);
  } while (false);
  return val;
}
string ns() {
  static char buff[1024 * 2000];
  scanf("%s", buff);
  return string{buff};
}
int64_t gcd(int64_t a, int64_t b) {
  while (b) {
    auto tmp = a % b;
    a = b;
    b = tmp;
  }
  return a;
}
template <typename T>
inline int sign(const T& val) {
  return val < 0 ? -1 : (val > 0 ? +1 : 0);
}
void ret(bool res) {}
int main() {
  auto n = ni(), m = ni(), z = ni();
  vector<bool> u(z + 1);
  for (int i = n; i <= z; i += n) u[i] = true;
  int ans = 0;
  for (int i = m; i <= z; i += m) {
    if (u[i]) ++ans;
  }
  cout << ans << endl;
  return 0;
}
