// editor2
#include<stdio.h>
int main()
{
    int n;
    scanf("%d",&n);
    int isNegative=0;
    if(n<0)
    {
        isNegative=1;
        n=-n;
    }
    char str[20];
    sprintf(str,"%d",n);
    for(int i=0;str[i] !='\0';i++)
    {
        if(str[i] == '0')
        {
            str[i]='1';
        }
    }
    int result;
    sscanf(str,"%d",&result);
    if(Isnegative)
    {
        result=-result;
    }
    printf("%d\n",result;)
    return 0;
}