import java.util.Scanner;
import java.util.Locale;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

public class Main {
  public static void main(String[] args ){

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int hundComplement = (10 - n / 100) * 100;
    int tenComplement =( 10 - n % 100 / 10) * 10;
    int oneComplement = 10 - n % 10;
    int result = hundComplement + tenComplement + oneComplement;

    System.out.println(result);
  }
} import java.util.Scanner; Scanner java.util import java.util.Locale; Locale java.util import java.time.LocalDate; LocalDate java.time import java.time.format.DateTimeFormatter; DateTimeFormatter java.time.format public class Main {
  public static void main(String[] args ){

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int hundComplement = (10 - n / 100) * 100;
    int tenComplement =( 10 - n % 100 / 10) * 10;
    int oneComplement = 10 - n % 10;
    int result = hundComplement + tenComplement + oneComplement;

    System.out.println(result);
  }
} Main public static void main(String[] args ){

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int hundComplement = (10 - n / 100) * 100;
    int tenComplement =( 10 - n % 100 / 10) * 10;
    int oneComplement = 10 - n % 10;
    int result = hundComplement + tenComplement + oneComplement;

    System.out.println(result);
  } main {

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int hundComplement = (10 - n / 100) * 100;
    int tenComplement =( 10 - n % 100 / 10) * 10;
    int oneComplement = 10 - n % 10;
    int result = hundComplement + tenComplement + oneComplement;

    System.out.println(result);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int hundComplement = (10 - n / 100) * 100; hundComplement (10 - n / 100) * 100 (10 - n / 100) 10 n / 100 n 100 100 int tenComplement =( 10 - n % 100 / 10) * 10; tenComplement ( 10 - n % 100 / 10) * 10 ( 10 - n % 100 / 10) 10 n % 100 / 10 n % 100 n 100 10 10 int oneComplement = 10 - n % 10; oneComplement 10 - n % 10 10 n % 10 n 10 int result = hundComplement + tenComplement + oneComplement; result hundComplement + tenComplement + oneComplement hundComplement + tenComplement + oneComplement hundComplement tenComplement oneComplement System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
  public static void main(String[] args ){

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int hundComplement = (10 - n / 100) * 100;
    int tenComplement =( 10 - n % 100 / 10) * 10;
    int oneComplement = 10 - n % 10;
    int result = hundComplement + tenComplement + oneComplement;

    System.out.println(result);
  }
} public class Main {
  public static void main(String[] args ){

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int hundComplement = (10 - n / 100) * 100;
    int tenComplement =( 10 - n % 100 / 10) * 10;
    int oneComplement = 10 - n % 10;
    int result = hundComplement + tenComplement + oneComplement;

    System.out.println(result);
  }
} Main
import java.util.Scanner;
import java.util.Locale;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

public class Main {
  public static void main(String[] args ){

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int hundComplement = (10 - n / 100) * 100;
    int tenComplement =( 10 - n % 100 / 10) * 10;
    int oneComplement = 10 - n % 10;
    int result = hundComplement + tenComplement + oneComplement;

    System.out.println(result);
  }
}
