import std.stdio, std.string;

void main() {
    string n = readln.chomp;
    string s = "0";
    int cnt;
    while (s != n) {
        s = succ(s);
        if (s.length % 2) ++cnt;
    }
    cnt.writeln;
}