import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
    	
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		int ans = 0;
		String Nlen = Integer.toString(N );

		for(int i = 0;i < Nlen.length();i++){
			int tmp = N % 10;
			double tmp2 = Math.pow(10, i);
			if(tmp == 1){
				ans = (int) (ans + 9*tmp2);
			}else if(tmp == 9){
				ans = (int) (ans + 1*tmp2);
			}else{
				ans = (int) (ans + 1*tmp2); 
			}
			N = N / 10;
		} 

		//最大の数
		System.out.println(ans);

   		sc.close();
        return ;

    }
    
}
 import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
    	
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		int ans = 0;
		String Nlen = Integer.toString(N );

		for(int i = 0;i < Nlen.length();i++){
			int tmp = N % 10;
			double tmp2 = Math.pow(10, i);
			if(tmp == 1){
				ans = (int) (ans + 9*tmp2);
			}else if(tmp == 9){
				ans = (int) (ans + 1*tmp2);
			}else{
				ans = (int) (ans + 1*tmp2); 
			}
			N = N / 10;
		} 

		//最大の数
		System.out.println(ans);

   		sc.close();
        return ;

    }
    
} Main public static void main(String[] args) {
    	
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		int ans = 0;
		String Nlen = Integer.toString(N );

		for(int i = 0;i < Nlen.length();i++){
			int tmp = N % 10;
			double tmp2 = Math.pow(10, i);
			if(tmp == 1){
				ans = (int) (ans + 9*tmp2);
			}else if(tmp == 9){
				ans = (int) (ans + 1*tmp2);
			}else{
				ans = (int) (ans + 1*tmp2); 
			}
			N = N / 10;
		} 

		//最大の数
		System.out.println(ans);

   		sc.close();
        return ;

    } main {
    	
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		int ans = 0;
		String Nlen = Integer.toString(N );

		for(int i = 0;i < Nlen.length();i++){
			int tmp = N % 10;
			double tmp2 = Math.pow(10, i);
			if(tmp == 1){
				ans = (int) (ans + 9*tmp2);
			}else if(tmp == 9){
				ans = (int) (ans + 1*tmp2);
			}else{
				ans = (int) (ans + 1*tmp2); 
			}
			N = N / 10;
		} 

		//最大の数
		System.out.println(ans);

   		sc.close();
        return ;

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int ans = 0; ans 0 String Nlen = Integer.toString(N ); Nlen Integer.toString(N ) Integer.toString Integer N for(int i = 0;i < Nlen.length();i++){
			int tmp = N % 10;
			double tmp2 = Math.pow(10, i);
			if(tmp == 1){
				ans = (int) (ans + 9*tmp2);
			}else if(tmp == 9){
				ans = (int) (ans + 1*tmp2);
			}else{
				ans = (int) (ans + 1*tmp2); 
			}
			N = N / 10;
		} int i = 0; int i = 0; i 0 i < Nlen.length() i Nlen.length() Nlen.length Nlen i++ i++ i {
			int tmp = N % 10;
			double tmp2 = Math.pow(10, i);
			if(tmp == 1){
				ans = (int) (ans + 9*tmp2);
			}else if(tmp == 9){
				ans = (int) (ans + 1*tmp2);
			}else{
				ans = (int) (ans + 1*tmp2); 
			}
			N = N / 10;
		} {
			int tmp = N % 10;
			double tmp2 = Math.pow(10, i);
			if(tmp == 1){
				ans = (int) (ans + 9*tmp2);
			}else if(tmp == 9){
				ans = (int) (ans + 1*tmp2);
			}else{
				ans = (int) (ans + 1*tmp2); 
			}
			N = N / 10;
		} int tmp = N % 10; tmp N % 10 N 10 double tmp2 = Math.pow(10, i); tmp2 Math.pow(10, i) Math.pow Math 10 i if(tmp == 1){
				ans = (int) (ans + 9*tmp2);
			}else if(tmp == 9){
				ans = (int) (ans + 1*tmp2);
			}else{
				ans = (int) (ans + 1*tmp2); 
			} tmp == 1 tmp 1 {
				ans = (int) (ans + 9*tmp2);
			} ans = (int) (ans + 9*tmp2) ans (int) (ans + 9*tmp2) ans 9*tmp2 9 tmp2 if(tmp == 9){
				ans = (int) (ans + 1*tmp2);
			}else{
				ans = (int) (ans + 1*tmp2); 
			} tmp == 9 tmp 9 {
				ans = (int) (ans + 1*tmp2);
			} ans = (int) (ans + 1*tmp2) ans (int) (ans + 1*tmp2) ans 1*tmp2 1 tmp2 {
				ans = (int) (ans + 1*tmp2); 
			} ans = (int) (ans + 1*tmp2) ans (int) (ans + 1*tmp2) ans 1*tmp2 1 tmp2 N = N / 10 N N / 10 N 10 System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc return ; String[] args args public class Main {

    public static void main(String[] args) {
    	
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		int ans = 0;
		String Nlen = Integer.toString(N );

		for(int i = 0;i < Nlen.length();i++){
			int tmp = N % 10;
			double tmp2 = Math.pow(10, i);
			if(tmp == 1){
				ans = (int) (ans + 9*tmp2);
			}else if(tmp == 9){
				ans = (int) (ans + 1*tmp2);
			}else{
				ans = (int) (ans + 1*tmp2); 
			}
			N = N / 10;
		} 

		//最大の数
		System.out.println(ans);

   		sc.close();
        return ;

    }
    
} public class Main {

    public static void main(String[] args) {
    	
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		int ans = 0;
		String Nlen = Integer.toString(N );

		for(int i = 0;i < Nlen.length();i++){
			int tmp = N % 10;
			double tmp2 = Math.pow(10, i);
			if(tmp == 1){
				ans = (int) (ans + 9*tmp2);
			}else if(tmp == 9){
				ans = (int) (ans + 1*tmp2);
			}else{
				ans = (int) (ans + 1*tmp2); 
			}
			N = N / 10;
		} 

		//最大の数
		System.out.println(ans);

   		sc.close();
        return ;

    }
    
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
    	
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		int ans = 0;
		String Nlen = Integer.toString(N );

		for(int i = 0;i < Nlen.length();i++){
			int tmp = N % 10;
			double tmp2 = Math.pow(10, i);
			if(tmp == 1){
				ans = (int) (ans + 9*tmp2);
			}else if(tmp == 9){
				ans = (int) (ans + 1*tmp2);
			}else{
				ans = (int) (ans + 1*tmp2); 
			}
			N = N / 10;
		} 

		//最大の数
		System.out.println(ans);

   		sc.close();
        return ;

    }
    
}

