#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, z;
  cin >> n >> m >> z;
  int a[10005] = {0}, b[10005] = {0};
  int x = 1, y = 1;
  for (int i = n; i <= z; i = i + n) a[i] = 1;
  for (int i = m; i <= z; i = i + m) b[i] = 1;
  int cnt = 0;
  for (int i = 1; i <= z; i++)
    if (a[i] == 1 && b[i] == 1) cnt++;
  cout << cnt;
  return 0;
}
