#import <Foundation/Foundation.h>
int main() {
  int N;
  scanf("%d", &N);
  NSInteger n = 1;
  NSInteger result;
  while(N >= n) {
    
    if (N < n * 10 - 1) {
      result += N - n + 1;
    } else {
      result += 9 * n;
    }
    
    n *= 100;
    
  }
  
  printf("%d", result);
  return 0;
}
  