#include <bits/stdc++.h>
using namespace std;
const long long N = 1e+6, oo = 1e+18, M = (1e+9) + 7;
int n, m, k;
long long ans = 0;
int main() {
  cin >> n >> m >> k;
  int vis[N] = {0};
  for (int i = 1; i * n <= k; i++) vis[i * n] = 1;
  for (int i = 1; i * m <= k; i++)
    if (vis[m * i]) ans++;
  cout << ans;
  return 0;
}
