Codeforces Round 395 (Div. 2)
A
Taymyr is calling you
Codeforces
800
原题
←B →
翻译中…

Comrade Dujikov is busy choosing artists for Timofey's birthday and is recieving calls from Taymyr from Ilia-alpinist.

翻译中…

Ilia-alpinist calls every $*n*$ minutes, i.e. in minutes $*n*$, $2*n*$, $3*n*$ and so on. Artists come to the comrade every $*m*$ minutes, i.e. in minutes $*m*$, $2*m*$, $3*m*$ and so on. The day is $*z*$ minutes long, i.e. the day consists of minutes $1, 2, ..., *z*$. How many artists should be killed so that there are no artists in the room when Ilia calls? Consider that a call and a talk with an artist take exactly one minute.

翻译中…

Input

翻译中…

The only string contains three integers — $*n*$, $*m*$ and $*z*$ ($1 ≤ *n*, *m*, *z* ≤ 10^{4}$).

翻译中…

Output

翻译中…

Print single integer — the minimum number of artists that should be killed so that there are no artists in the room when Ilia calls.

翻译中…

Note

翻译中…

Taymyr is a place in the north of Russia.

翻译中…

In the first test the artists come each minute, as well as the calls, so we need to kill all of them.

翻译中…

In the second test we need to kill artists which come on the second and the fourth minutes.

翻译中…

In the third test — only the artist which comes on the sixth minute.

翻译中…

样例

Input #1
1 1 10
Output #1
10
InputCopy OutputCopy
Input #2
1 2 5
Output #2
2
InputCopy OutputCopy
Input #3
2 3 9
Output #3
1
InputCopy OutputCopy
题目信息
题号
764A
时间限制
1 s
内存限制
255 MB
标签
暴力
模拟
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。