import java.util.*;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   System.out.println(1110-sc.nextInt());
 }
} import java.util.*; util.* java public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   System.out.println(1110-sc.nextInt());
 }
} Main public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   System.out.println(1110-sc.nextInt());
 } main {
   Scanner sc = new Scanner(System.in);
   System.out.println(1110-sc.nextInt());
 } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) System.out.println(1110-sc.nextInt()) System.out.println System.out System System.out 1110-sc.nextInt() 1110 sc.nextInt() sc.nextInt sc String[] args args public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   System.out.println(1110-sc.nextInt());
 }
} public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   System.out.println(1110-sc.nextInt());
 }
} Main
import java.util.*;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   System.out.println(1110-sc.nextInt());
 }
}