import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a = 10 - (n / 100);
        int b = 10 - ((n % 100) / 10);
        int c = 10 - (n % 10);
        int ans = a * 100 + b * 10 + c;

        System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a = 10 - (n / 100);
        int b = 10 - ((n % 100) / 10);
        int c = 10 - (n % 10);
        int ans = a * 100 + b * 10 + c;

        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a = 10 - (n / 100);
        int b = 10 - ((n % 100) / 10);
        int c = 10 - (n % 10);
        int ans = a * 100 + b * 10 + c;

        System.out.println(ans);
    } main {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a = 10 - (n / 100);
        int b = 10 - ((n % 100) / 10);
        int c = 10 - (n % 10);
        int ans = a * 100 + b * 10 + c;

        System.out.println(ans);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int a = 10 - (n / 100); a 10 - (n / 100) 10 (n / 100) n 100 int b = 10 - ((n % 100) / 10); b 10 - ((n % 100) / 10) 10 ((n % 100) / 10) (n % 100) n 100 10 int c = 10 - (n % 10); c 10 - (n % 10) 10 (n % 10) n 10 int ans = a * 100 + b * 10 + c; ans a * 100 + b * 10 + c a * 100 + b * 10 + c a * 100 a 100 b * 10 b 10 c System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a = 10 - (n / 100);
        int b = 10 - ((n % 100) / 10);
        int c = 10 - (n % 10);
        int ans = a * 100 + b * 10 + c;

        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a = 10 - (n / 100);
        int b = 10 - ((n % 100) / 10);
        int c = 10 - (n % 10);
        int ans = a * 100 + b * 10 + c;

        System.out.println(ans);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a = 10 - (n / 100);
        int b = 10 - ((n % 100) / 10);
        int c = 10 - (n % 10);
        int ans = a * 100 + b * 10 + c;

        System.out.println(ans);
    }
}