import java.util.Scanner;

public class Main {

	/** 数字の和 */
	private static final int SUM = 999 + 111;

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			System.out.println(SUM - n);
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {

	/** 数字の和 */
	private static final int SUM = 999 + 111;

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			System.out.println(SUM - n);
		}
	}
} Main /** 数字の和 */
	private static final int SUM = 999 + 111; SUM 999 + 111 999 111 public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			System.out.println(SUM - n);
		}
	} main {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			System.out.println(SUM - n);
		}
	} try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			System.out.println(SUM - n);
		} {
			int n = scanner.nextInt();
			System.out.println(SUM - n);
		} Scanner scanner = new Scanner(System.in) Scanner scanner = new Scanner(System.in) new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner System.out.println(SUM - n) System.out.println System.out System System.out SUM - n SUM n String[] args args public class Main {

	/** 数字の和 */
	private static final int SUM = 999 + 111;

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			System.out.println(SUM - n);
		}
	}
} public class Main {

	/** 数字の和 */
	private static final int SUM = 999 + 111;

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			System.out.println(SUM - n);
		}
	}
} Main
import java.util.Scanner;

public class Main {

	/** 数字の和 */
	private static final int SUM = 999 + 111;

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			System.out.println(SUM - n);
		}
	}
}
