import java.util.*;
class Main {
  public static void main (String[] args) {
    
    Scanner scan = new Scanner (System.in);
    
    int x = scan.nextInt();
    String str = String.valueOf(x);
    
    if (str.charAt(0)=='1'){
      x = x + 800;
      }else{
        x = x -800;
        }
        
       
       
      
        if (str.charAt(1)=='1'){
      x = x + 80;
      }else{
        x = x -80;
        }
        
        
     
          if (str.charAt(2)=='1'){
      x = x + 8;
      }else{
        x = x -8;
        }
    
    System.out.println(x);
}
} import java.util.*; util.* java class Main {
  public static void main (String[] args) {
    
    Scanner scan = new Scanner (System.in);
    
    int x = scan.nextInt();
    String str = String.valueOf(x);
    
    if (str.charAt(0)=='1'){
      x = x + 800;
      }else{
        x = x -800;
        }
        
       
       
      
        if (str.charAt(1)=='1'){
      x = x + 80;
      }else{
        x = x -80;
        }
        
        
     
          if (str.charAt(2)=='1'){
      x = x + 8;
      }else{
        x = x -8;
        }
    
    System.out.println(x);
}
} Main public static void main (String[] args) {
    
    Scanner scan = new Scanner (System.in);
    
    int x = scan.nextInt();
    String str = String.valueOf(x);
    
    if (str.charAt(0)=='1'){
      x = x + 800;
      }else{
        x = x -800;
        }
        
       
       
      
        if (str.charAt(1)=='1'){
      x = x + 80;
      }else{
        x = x -80;
        }
        
        
     
          if (str.charAt(2)=='1'){
      x = x + 8;
      }else{
        x = x -8;
        }
    
    System.out.println(x);
} main {
    
    Scanner scan = new Scanner (System.in);
    
    int x = scan.nextInt();
    String str = String.valueOf(x);
    
    if (str.charAt(0)=='1'){
      x = x + 800;
      }else{
        x = x -800;
        }
        
       
       
      
        if (str.charAt(1)=='1'){
      x = x + 80;
      }else{
        x = x -80;
        }
        
        
     
          if (str.charAt(2)=='1'){
      x = x + 8;
      }else{
        x = x -8;
        }
    
    System.out.println(x);
} Scanner scan = new Scanner (System.in); scan new Scanner (System.in) int x = scan.nextInt(); x scan.nextInt() scan.nextInt scan String str = String.valueOf(x); str String.valueOf(x) String.valueOf String x if (str.charAt(0)=='1'){
      x = x + 800;
      }else{
        x = x -800;
        } str.charAt(0)=='1' str.charAt(0) str.charAt str 0 '1' {
      x = x + 800;
      } x = x + 800 x x + 800 x 800 {
        x = x -800;
        } x = x -800 x x -800 x 800 if (str.charAt(1)=='1'){
      x = x + 80;
      }else{
        x = x -80;
        } str.charAt(1)=='1' str.charAt(1) str.charAt str 1 '1' {
      x = x + 80;
      } x = x + 80 x x + 80 x 80 {
        x = x -80;
        } x = x -80 x x -80 x 80 if (str.charAt(2)=='1'){
      x = x + 8;
      }else{
        x = x -8;
        } str.charAt(2)=='1' str.charAt(2) str.charAt str 2 '1' {
      x = x + 8;
      } x = x + 8 x x + 8 x 8 {
        x = x -8;
        } x = x -8 x x -8 x 8 System.out.println(x) System.out.println System.out System System.out x String[] args args
import java.util.*;
class Main {
  public static void main (String[] args) {
    
    Scanner scan = new Scanner (System.in);
    
    int x = scan.nextInt();
    String str = String.valueOf(x);
    
    if (str.charAt(0)=='1'){
      x = x + 800;
      }else{
        x = x -800;
        }
        
       
       
      
        if (str.charAt(1)=='1'){
      x = x + 80;
      }else{
        x = x -80;
        }
        
        
     
          if (str.charAt(2)=='1'){
      x = x + 8;
      }else{
        x = x -8;
        }
    
    System.out.println(x);
}
}
