// editor2
#include <stdio.h>
#include <math.h> 

int replaceZerosWithOnes(int n) {
    // Handle the case of zero separately
    if (n == 0) {
        return 1;
    }

    int sign = (n < 0) ? -1 : 1;
    n = abs(n); // Work with the absolute value

    int result = 0;
    int power = 1;

    while (n > 0) {
        int digit = n % 10;
        if (digit == 0) {
            result += 1 * power; // Replace 0 with 1
        } else {
            result += digit * power; // Keep other digits as they are
        }
        n /= 10;
        power *= 10;
    }
    return result * sign; // Apply the original sign
}

int main() {
    int n;
    scanf("%d", &n); // Read the input integer

    int modified_n = replaceZerosWithOnes(n); // Call the function to modify the number
    printf("%d\n", modified_n); // Print the modified number

    return 0;
}