#!/bin/bash

read n
p=$((${#n}/2))
if [ $p -eq 0 ]; then
  echo $n
  exit
else
  x=$((9+900*(p/2)+90000*(p/3)))
fi
if [ $((${#n}&1)) -eq 0 ]; then
  echo $x
else
  k=$((10**(${#n}-1)))
  echo $((x+(n%k)+1))
fi
