import java.util.Scanner;

public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int n = in.nextInt();
      int ans = 0;
      int tenExp = 1;

      while (n > 0) {
        if (n % 10 == 9) {
          ans += 1 * tenExp;
        } else {
          ans += 9 * tenExp;        
        }

        n /= 10;
        tenExp *= 10;
      }

      System.out.println(ans);
    }
  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int n = in.nextInt();
      int ans = 0;
      int tenExp = 1;

      while (n > 0) {
        if (n % 10 == 9) {
          ans += 1 * tenExp;
        } else {
          ans += 9 * tenExp;        
        }

        n /= 10;
        tenExp *= 10;
      }

      System.out.println(ans);
    }
  }
} Main public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int n = in.nextInt();
      int ans = 0;
      int tenExp = 1;

      while (n > 0) {
        if (n % 10 == 9) {
          ans += 1 * tenExp;
        } else {
          ans += 9 * tenExp;        
        }

        n /= 10;
        tenExp *= 10;
      }

      System.out.println(ans);
    }
  } main {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int n = in.nextInt();
      int ans = 0;
      int tenExp = 1;

      while (n > 0) {
        if (n % 10 == 9) {
          ans += 1 * tenExp;
        } else {
          ans += 9 * tenExp;        
        }

        n /= 10;
        tenExp *= 10;
      }

      System.out.println(ans);
    }
  } Scanner in = new Scanner(System.in); in new Scanner(System.in) while (in.hasNext()) {
      int n = in.nextInt();
      int ans = 0;
      int tenExp = 1;

      while (n > 0) {
        if (n % 10 == 9) {
          ans += 1 * tenExp;
        } else {
          ans += 9 * tenExp;        
        }

        n /= 10;
        tenExp *= 10;
      }

      System.out.println(ans);
    } in.hasNext() in.hasNext in {
      int n = in.nextInt();
      int ans = 0;
      int tenExp = 1;

      while (n > 0) {
        if (n % 10 == 9) {
          ans += 1 * tenExp;
        } else {
          ans += 9 * tenExp;        
        }

        n /= 10;
        tenExp *= 10;
      }

      System.out.println(ans);
    } int n = in.nextInt(); n in.nextInt() in.nextInt in int ans = 0; ans 0 int tenExp = 1; tenExp 1 while (n > 0) {
        if (n % 10 == 9) {
          ans += 1 * tenExp;
        } else {
          ans += 9 * tenExp;        
        }

        n /= 10;
        tenExp *= 10;
      } n > 0 n 0 {
        if (n % 10 == 9) {
          ans += 1 * tenExp;
        } else {
          ans += 9 * tenExp;        
        }

        n /= 10;
        tenExp *= 10;
      } if (n % 10 == 9) {
          ans += 1 * tenExp;
        } else {
          ans += 9 * tenExp;        
        } n % 10 == 9 n % 10 n 10 9 {
          ans += 1 * tenExp;
        } ans += 1 * tenExp ans 1 * tenExp 1 tenExp {
          ans += 9 * tenExp;        
        } ans += 9 * tenExp ans 9 * tenExp 9 tenExp n /= 10 n 10 tenExp *= 10 tenExp 10 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 in = new Scanner(System.in);

    while (in.hasNext()) {
      int n = in.nextInt();
      int ans = 0;
      int tenExp = 1;

      while (n > 0) {
        if (n % 10 == 9) {
          ans += 1 * tenExp;
        } else {
          ans += 9 * tenExp;        
        }

        n /= 10;
        tenExp *= 10;
      }

      System.out.println(ans);
    }
  }
} public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int n = in.nextInt();
      int ans = 0;
      int tenExp = 1;

      while (n > 0) {
        if (n % 10 == 9) {
          ans += 1 * tenExp;
        } else {
          ans += 9 * tenExp;        
        }

        n /= 10;
        tenExp *= 10;
      }

      System.out.println(ans);
    }
  }
} Main
import java.util.Scanner;

public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int n = in.nextInt();
      int ans = 0;
      int tenExp = 1;

      while (n > 0) {
        if (n % 10 == 9) {
          ans += 1 * tenExp;
        } else {
          ans += 9 * tenExp;        
        }

        n /= 10;
        tenExp *= 10;
      }

      System.out.println(ans);
    }
  }
}