![在这里插入图片描述](https://img-blog.csdnimg.cn/20190323194854448.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzc4NjE0Mw==,size_16,color_FFFFFF,t_70)
#include <iostream>
using namespace std;
int euler(int n) {
int res = n;
for (int i = 2; i <= n; i++) {
if (n % i == 0) {
res = res/i*(i-1);
while (n % i == 0) {
n /= i;
}
}
}
return res;
}
int main() {
int n;
cin >> n;
cout << euler(n) << endl;
return 0;
}