import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int n = sc.nextInt();
                int answer = 0;
		if(n/100 == 9){
			answer = 100;
			n=n-900;
		}else{
			answer = 900;
			n=n-100;
		}
		if(n/10 == 9){
			answer = answer+10;
			n=n-90;
		}else{
			answer = answer+90;
			n=n-10;
		}
		if(n == 9){
			answer = answer+1;
			
		}else{
			answer = answer+9;
		}
		System.out.println(answer);
	}
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int n = sc.nextInt();
                int answer = 0;
		if(n/100 == 9){
			answer = 100;
			n=n-900;
		}else{
			answer = 900;
			n=n-100;
		}
		if(n/10 == 9){
			answer = answer+10;
			n=n-90;
		}else{
			answer = answer+90;
			n=n-10;
		}
		if(n == 9){
			answer = answer+1;
			
		}else{
			answer = answer+9;
		}
		System.out.println(answer);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int n = sc.nextInt();
                int answer = 0;
		if(n/100 == 9){
			answer = 100;
			n=n-900;
		}else{
			answer = 900;
			n=n-100;
		}
		if(n/10 == 9){
			answer = answer+10;
			n=n-90;
		}else{
			answer = answer+90;
			n=n-10;
		}
		if(n == 9){
			answer = answer+1;
			
		}else{
			answer = answer+9;
		}
		System.out.println(answer);
	} main {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int n = sc.nextInt();
                int answer = 0;
		if(n/100 == 9){
			answer = 100;
			n=n-900;
		}else{
			answer = 900;
			n=n-100;
		}
		if(n/10 == 9){
			answer = answer+10;
			n=n-90;
		}else{
			answer = answer+90;
			n=n-10;
		}
		if(n == 9){
			answer = answer+1;
			
		}else{
			answer = answer+9;
		}
		System.out.println(answer);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int answer = 0; answer 0 if(n/100 == 9){
			answer = 100;
			n=n-900;
		}else{
			answer = 900;
			n=n-100;
		} n/100 == 9 n/100 n 100 9 {
			answer = 100;
			n=n-900;
		} answer = 100 answer 100 n=n-900 n n-900 n 900 {
			answer = 900;
			n=n-100;
		} answer = 900 answer 900 n=n-100 n n-100 n 100 if(n/10 == 9){
			answer = answer+10;
			n=n-90;
		}else{
			answer = answer+90;
			n=n-10;
		} n/10 == 9 n/10 n 10 9 {
			answer = answer+10;
			n=n-90;
		} answer = answer+10 answer answer+10 answer 10 n=n-90 n n-90 n 90 {
			answer = answer+90;
			n=n-10;
		} answer = answer+90 answer answer+90 answer 90 n=n-10 n n-10 n 10 if(n == 9){
			answer = answer+1;
			
		}else{
			answer = answer+9;
		} n == 9 n 9 {
			answer = answer+1;
			
		} answer = answer+1 answer answer+1 answer 1 {
			answer = answer+9;
		} answer = answer+9 answer answer+9 answer 9 System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int n = sc.nextInt();
                int answer = 0;
		if(n/100 == 9){
			answer = 100;
			n=n-900;
		}else{
			answer = 900;
			n=n-100;
		}
		if(n/10 == 9){
			answer = answer+10;
			n=n-90;
		}else{
			answer = answer+90;
			n=n-10;
		}
		if(n == 9){
			answer = answer+1;
			
		}else{
			answer = answer+9;
		}
		System.out.println(answer);
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int n = sc.nextInt();
                int answer = 0;
		if(n/100 == 9){
			answer = 100;
			n=n-900;
		}else{
			answer = 900;
			n=n-100;
		}
		if(n/10 == 9){
			answer = answer+10;
			n=n-90;
		}else{
			answer = answer+90;
			n=n-10;
		}
		if(n == 9){
			answer = answer+1;
			
		}else{
			answer = answer+9;
		}
		System.out.println(answer);
	}
} Main
import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int n = sc.nextInt();
                int answer = 0;
		if(n/100 == 9){
			answer = 100;
			n=n-900;
		}else{
			answer = 900;
			n=n-100;
		}
		if(n/10 == 9){
			answer = answer+10;
			n=n-90;
		}else{
			answer = answer+90;
			n=n-10;
		}
		if(n == 9){
			answer = answer+1;
			
		}else{
			answer = answer+9;
		}
		System.out.println(answer);
	}
}