#include<bits/stdc++.h>
using namespace std;
bool check(int x){
if(x%5==1){
x = x-1-x/5;
if(x%5==2){
x = x-2-x/5;
if(x%5==3){
x= x-3-x/5;
if(x%5==4){
x = x-4-x/5;
//这里一定要考虑x等于0的情况
//0与任何数取余都为0!!
if(x%5==0&&x!=0) return true;
}
}
}
}
return false;
}
int main(){
int k = 1;
while(true){
if(check(k))
break;
k++;
}
cout<<k<<endl;
return 0;
}