import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int z=0;
		if(N/100==9)
			z=100;
		else
			z=900;
		if((N%100)/10==9)
			z+=10;
		else
			z+=90;
		if(((N%100)%10)==9)
			z+=1;
		else
			z+=9;
		System.out.println(z);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int z=0;
		if(N/100==9)
			z=100;
		else
			z=900;
		if((N%100)/10==9)
			z+=10;
		else
			z+=90;
		if(((N%100)%10)==9)
			z+=1;
		else
			z+=9;
		System.out.println(z);
	}
} Main public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int z=0;
		if(N/100==9)
			z=100;
		else
			z=900;
		if((N%100)/10==9)
			z+=10;
		else
			z+=90;
		if(((N%100)%10)==9)
			z+=1;
		else
			z+=9;
		System.out.println(z);
	} main {
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int z=0;
		if(N/100==9)
			z=100;
		else
			z=900;
		if((N%100)/10==9)
			z+=10;
		else
			z+=90;
		if(((N%100)%10)==9)
			z+=1;
		else
			z+=9;
		System.out.println(z);
	} Scanner stdIn=new Scanner(System.in); stdIn new Scanner(System.in) int N=stdIn.nextInt(); N stdIn.nextInt() stdIn.nextInt stdIn int z=0; z 0 if(N/100==9)
			z=100;
		else
			z=900; N/100==9 N/100 N 100 9 z=100 z 100 z=900 z 900 if((N%100)/10==9)
			z+=10;
		else
			z+=90; (N%100)/10==9 (N%100)/10 (N%100) N 100 10 9 z+=10 z 10 z+=90 z 90 if(((N%100)%10)==9)
			z+=1;
		else
			z+=9; ((N%100)%10)==9 ((N%100)%10) (N%100) N 100 10 9 z+=1 z 1 z+=9 z 9 System.out.println(z) System.out.println System.out System System.out z String[] args args public class Main {
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int z=0;
		if(N/100==9)
			z=100;
		else
			z=900;
		if((N%100)/10==9)
			z+=10;
		else
			z+=90;
		if(((N%100)%10)==9)
			z+=1;
		else
			z+=9;
		System.out.println(z);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int z=0;
		if(N/100==9)
			z=100;
		else
			z=900;
		if((N%100)/10==9)
			z+=10;
		else
			z+=90;
		if(((N%100)%10)==9)
			z+=1;
		else
			z+=9;
		System.out.println(z);
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int z=0;
		if(N/100==9)
			z=100;
		else
			z=900;
		if((N%100)/10==9)
			z+=10;
		else
			z+=90;
		if(((N%100)%10)==9)
			z+=1;
		else
			z+=9;
		System.out.println(z);
	}
}
