import java.util.Scanner;

public class Main {

  public static void main(String[] args) {

    Scanner scan = new Scanner(System.in);

    int n = scan.nextInt();

    if (n >= 10) {
      if (n >= 100) {
        if (n >= 1000) {
          if (n >= 10000) {
            if (n == 100000) {
              System.out.println(90909);
            } else {
              System.out.println(n - 9090);
            }
          } else {
            System.out.println(909);
          }
        } else {
          System.out.println(n - 90);
        }
      } else {
        System.out.println(9);
      }
    } else {
      System.out.println(n);
    }
  }

} import java.util.Scanner; Scanner java.util public class Main {

  public static void main(String[] args) {

    Scanner scan = new Scanner(System.in);

    int n = scan.nextInt();

    if (n >= 10) {
      if (n >= 100) {
        if (n >= 1000) {
          if (n >= 10000) {
            if (n == 100000) {
              System.out.println(90909);
            } else {
              System.out.println(n - 9090);
            }
          } else {
            System.out.println(909);
          }
        } else {
          System.out.println(n - 90);
        }
      } else {
        System.out.println(9);
      }
    } else {
      System.out.println(n);
    }
  }

} Main public static void main(String[] args) {

    Scanner scan = new Scanner(System.in);

    int n = scan.nextInt();

    if (n >= 10) {
      if (n >= 100) {
        if (n >= 1000) {
          if (n >= 10000) {
            if (n == 100000) {
              System.out.println(90909);
            } else {
              System.out.println(n - 9090);
            }
          } else {
            System.out.println(909);
          }
        } else {
          System.out.println(n - 90);
        }
      } else {
        System.out.println(9);
      }
    } else {
      System.out.println(n);
    }
  } main {

    Scanner scan = new Scanner(System.in);

    int n = scan.nextInt();

    if (n >= 10) {
      if (n >= 100) {
        if (n >= 1000) {
          if (n >= 10000) {
            if (n == 100000) {
              System.out.println(90909);
            } else {
              System.out.println(n - 9090);
            }
          } else {
            System.out.println(909);
          }
        } else {
          System.out.println(n - 90);
        }
      } else {
        System.out.println(9);
      }
    } else {
      System.out.println(n);
    }
  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan if (n >= 10) {
      if (n >= 100) {
        if (n >= 1000) {
          if (n >= 10000) {
            if (n == 100000) {
              System.out.println(90909);
            } else {
              System.out.println(n - 9090);
            }
          } else {
            System.out.println(909);
          }
        } else {
          System.out.println(n - 90);
        }
      } else {
        System.out.println(9);
      }
    } else {
      System.out.println(n);
    } n >= 10 n 10 {
      if (n >= 100) {
        if (n >= 1000) {
          if (n >= 10000) {
            if (n == 100000) {
              System.out.println(90909);
            } else {
              System.out.println(n - 9090);
            }
          } else {
            System.out.println(909);
          }
        } else {
          System.out.println(n - 90);
        }
      } else {
        System.out.println(9);
      }
    } if (n >= 100) {
        if (n >= 1000) {
          if (n >= 10000) {
            if (n == 100000) {
              System.out.println(90909);
            } else {
              System.out.println(n - 9090);
            }
          } else {
            System.out.println(909);
          }
        } else {
          System.out.println(n - 90);
        }
      } else {
        System.out.println(9);
      } n >= 100 n 100 {
        if (n >= 1000) {
          if (n >= 10000) {
            if (n == 100000) {
              System.out.println(90909);
            } else {
              System.out.println(n - 9090);
            }
          } else {
            System.out.println(909);
          }
        } else {
          System.out.println(n - 90);
        }
      } if (n >= 1000) {
          if (n >= 10000) {
            if (n == 100000) {
              System.out.println(90909);
            } else {
              System.out.println(n - 9090);
            }
          } else {
            System.out.println(909);
          }
        } else {
          System.out.println(n - 90);
        } n >= 1000 n 1000 {
          if (n >= 10000) {
            if (n == 100000) {
              System.out.println(90909);
            } else {
              System.out.println(n - 9090);
            }
          } else {
            System.out.println(909);
          }
        } if (n >= 10000) {
            if (n == 100000) {
              System.out.println(90909);
            } else {
              System.out.println(n - 9090);
            }
          } else {
            System.out.println(909);
          } n >= 10000 n 10000 {
            if (n == 100000) {
              System.out.println(90909);
            } else {
              System.out.println(n - 9090);
            }
          } if (n == 100000) {
              System.out.println(90909);
            } else {
              System.out.println(n - 9090);
            } n == 100000 n 100000 {
              System.out.println(90909);
            } System.out.println(90909) System.out.println System.out System System.out 90909 {
              System.out.println(n - 9090);
            } System.out.println(n - 9090) System.out.println System.out System System.out n - 9090 n 9090 {
            System.out.println(909);
          } System.out.println(909) System.out.println System.out System System.out 909 {
          System.out.println(n - 90);
        } System.out.println(n - 90) System.out.println System.out System System.out n - 90 n 90 {
        System.out.println(9);
      } System.out.println(9) System.out.println System.out System System.out 9 {
      System.out.println(n);
    } System.out.println(n) System.out.println System.out System System.out n String[] args args public class Main {

  public static void main(String[] args) {

    Scanner scan = new Scanner(System.in);

    int n = scan.nextInt();

    if (n >= 10) {
      if (n >= 100) {
        if (n >= 1000) {
          if (n >= 10000) {
            if (n == 100000) {
              System.out.println(90909);
            } else {
              System.out.println(n - 9090);
            }
          } else {
            System.out.println(909);
          }
        } else {
          System.out.println(n - 90);
        }
      } else {
        System.out.println(9);
      }
    } else {
      System.out.println(n);
    }
  }

} public class Main {

  public static void main(String[] args) {

    Scanner scan = new Scanner(System.in);

    int n = scan.nextInt();

    if (n >= 10) {
      if (n >= 100) {
        if (n >= 1000) {
          if (n >= 10000) {
            if (n == 100000) {
              System.out.println(90909);
            } else {
              System.out.println(n - 9090);
            }
          } else {
            System.out.println(909);
          }
        } else {
          System.out.println(n - 90);
        }
      } else {
        System.out.println(9);
      }
    } else {
      System.out.println(n);
    }
  }

} Main
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {

    Scanner scan = new Scanner(System.in);

    int n = scan.nextInt();

    if (n >= 10) {
      if (n >= 100) {
        if (n >= 1000) {
          if (n >= 10000) {
            if (n == 100000) {
              System.out.println(90909);
            } else {
              System.out.println(n - 9090);
            }
          } else {
            System.out.println(909);
          }
        } else {
          System.out.println(n - 90);
        }
      } else {
        System.out.println(9);
      }
    } else {
      System.out.println(n);
    }
  }

}