#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using ii = pair<int, int>;
using ll = long long;
int main() {
  int a, b, n;
  cin >> a >> b >> n;
  int cnt = 0;
  vi vis(n + 1, 0);
  for (int i = a; i <= n; i += a) vis[i] = 1;
  for (int i = b; i <= n; i += b)
    if (vis[i]) cnt++;
  cout << cnt << endl;
  return 0;
}
