#include
#include<math.h>
using namespace std;
int convert0to5(int a){
int z,ans=0,i=0;
while(a!=0){
z=a%10;
if(z==0){
z=5;
}
ans = ans+ (z*pow(10,i));
i++;
a/=10;
}
return ans;
}
int main(){
long long int n;
cin>>n;
cout<<convert0to5(n);
}
i have sent the code for reference