#include <bits/stdc++.h>
using namespace std;
int arr[10000];
int main() {
  int a, b, c, x = 0;
  cin >> a >> b >> c;
  for (int i = b; i <= c; i += b) {
    if (i > c) break;
    arr[i]++;
  }
  for (int i = a; i <= c; i += a) {
    if (i > c) break;
    arr[i]++;
    if (arr[i] == 2) x++;
  }
  cout << x << endl;
  return 0;
}
