#P10424. Good Numbers

    ID: 12435 Type: Default 1000ms 256MiB

Good Numbers

Good Numbers

A positive integer is called a Good Number if, when its digits are read from the least significant (units) digit to the most significant digit, the digits in the odd positions are odd and the digits in the even positions are even. Formally, consider a number represented in decimal as \(a_k a_{k-1} \dots a_1\) (where \(a_1\) is the units digit). The number is a Good Number if for every position \(i\) (with \(1 \le i \le k\)) the following conditions hold:

  • If \(i\) is odd then \(a_i\) is odd.
  • If \(i\) is even then \(a_i\) is even.

Given a positive integer \(N\), your task is to compute the number of Good Numbers in the range \([1, N]\).

inputFormat

The input consists of a single positive integer \(N\).

outputFormat

Output a single integer representing the count of Good Numbers between 1 and \(N\) (inclusive).

sample

1
1