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;
    int conf = 0;
    for (int i = 0; i < 3; i++) {
      if ((n / (int)Math.pow(10, i)) % 10 == 1) {
        ans += 9 * Math.pow(10, i);
      } else {
        ans += 1 * Math.pow(10, i);
      }
    }
    System.out.println(ans);

  }

} 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;
    int conf = 0;
    for (int i = 0; i < 3; i++) {
      if ((n / (int)Math.pow(10, i)) % 10 == 1) {
        ans += 9 * Math.pow(10, i);
      } else {
        ans += 1 * Math.pow(10, i);
      }
    }
    System.out.println(ans);

  }

} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int ans = 0;
    int conf = 0;
    for (int i = 0; i < 3; i++) {
      if ((n / (int)Math.pow(10, i)) % 10 == 1) {
        ans += 9 * Math.pow(10, i);
      } else {
        ans += 1 * Math.pow(10, i);
      }
    }
    System.out.println(ans);

  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int ans = 0;
    int conf = 0;
    for (int i = 0; i < 3; i++) {
      if ((n / (int)Math.pow(10, i)) % 10 == 1) {
        ans += 9 * Math.pow(10, i);
      } else {
        ans += 1 * Math.pow(10, i);
      }
    }
    System.out.println(ans);

  } 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 int conf = 0; conf 0 for (int i = 0; i < 3; i++) {
      if ((n / (int)Math.pow(10, i)) % 10 == 1) {
        ans += 9 * Math.pow(10, i);
      } else {
        ans += 1 * Math.pow(10, i);
      }
    } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
      if ((n / (int)Math.pow(10, i)) % 10 == 1) {
        ans += 9 * Math.pow(10, i);
      } else {
        ans += 1 * Math.pow(10, i);
      }
    } {
      if ((n / (int)Math.pow(10, i)) % 10 == 1) {
        ans += 9 * Math.pow(10, i);
      } else {
        ans += 1 * Math.pow(10, i);
      }
    } if ((n / (int)Math.pow(10, i)) % 10 == 1) {
        ans += 9 * Math.pow(10, i);
      } else {
        ans += 1 * Math.pow(10, i);
      } (n / (int)Math.pow(10, i)) % 10 == 1 (n / (int)Math.pow(10, i)) % 10 (n / (int)Math.pow(10, i)) n (int)Math.pow(10, i) Math.pow Math 10 i 10 1 {
        ans += 9 * Math.pow(10, i);
      } ans += 9 * Math.pow(10, i) ans 9 * Math.pow(10, i) 9 Math.pow(10, i) Math.pow Math 10 i {
        ans += 1 * Math.pow(10, i);
      } ans += 1 * Math.pow(10, i) ans 1 * Math.pow(10, i) 1 Math.pow(10, i) Math.pow Math 10 i 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 sc = new Scanner(System.in);
    int n = sc.nextInt();
    int ans = 0;
    int conf = 0;
    for (int i = 0; i < 3; i++) {
      if ((n / (int)Math.pow(10, i)) % 10 == 1) {
        ans += 9 * Math.pow(10, i);
      } else {
        ans += 1 * Math.pow(10, i);
      }
    }
    System.out.println(ans);

  }

} public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int ans = 0;
    int conf = 0;
    for (int i = 0; i < 3; i++) {
      if ((n / (int)Math.pow(10, i)) % 10 == 1) {
        ans += 9 * Math.pow(10, i);
      } else {
        ans += 1 * Math.pow(10, i);
      }
    }
    System.out.println(ans);

  }

} Main
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;
    int conf = 0;
    for (int i = 0; i < 3; i++) {
      if ((n / (int)Math.pow(10, i)) % 10 == 1) {
        ans += 9 * Math.pow(10, i);
      } else {
        ans += 1 * Math.pow(10, i);
      }
    }
    System.out.println(ans);

  }

}
