#include <bits/stdc++.h>
const long long LINF = LLONG_MAX / 2;
const int INF = INT_MAX / 2;
const int MAXN = 500 + 10;
const int MOD = 1000000009;
template <typename T>
T GCD(T a, T b) {
  if (!b) return a;
  return GCD(b, a % b);
}
using namespace std;
int main() {
  int a, b, c, ans = 0;
  cin >> a >> b >> c;
  for (int i = 1; a * i <= c; i++)
    if (a * i % b == 0) ans++;
  printf("%d\n", ans);
  return 0;
}
