Uneven Numbers

AtCoder
IDabc136_b
Time2000ms
Memory256MB
Difficulty
Given is an integer $N$. Find the number of positive integers less than or equal to $N$ that have an odd number of digits (in base ten without leading zeros). ## Constraints * $1 \leq N \leq 10^5$ ## Input Input is given from Standard Input in the following format: $N$ [samples]
Samples
Input #1
11
Output #1
9

Among the positive integers less than or equal to $11$, nine integers have an odd number of digits: $1, 2, \ldots, 9$.
Input #2
136
Output #2
46

In addition to $1, 2, \ldots, 9$, another $37$ integers also have an odd number of digits: $100, 101, \ldots, 136$.
Input #3
100000
Output #3
90909
API Response (JSON)
{
  "problem": {
    "name": "Uneven Numbers",
    "description": {
      "content": "Given is an integer $N$. Find the number of positive integers less than or equal to $N$ that have an odd number of digits (in base ten without leading zeros).",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc136_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Given is an integer $N$. Find the number of positive integers less than or equal to $N$ that have an odd number of digits (in base ten without leading zeros).\n\n## Constraints\n\n*   $1 \\leq N \\leq 10^5$...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments