Submit solution

Points:
5

Time limit:
1.0s

Memory limit:
64M

Author:

Problem types

Allowed languages

Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, ~~CommonLisp~~, D, Dart, F#, Forth, Fortran, Go, ~~Groovy~~, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, ~~Nim~~, ~~ObjC~~, OCaml, ~~Octave~~, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

It's and , wants to know how many different numbers less than or equal to that only consist of digits that are either or .

's birthday, and wants to give him a gift. Knowing that he loves the numbers#### Subtasks

- (20 points)
- (80 points) No additional constraints.

#### Input Specifications

A single integer .

#### Output Specifications

The answer to the problem, on a single line.

#### Sample Input 1

`13`

#### Sample Output 1

`2`

#### Explanation for Sample 1

The only two numbers are and .

#### Sample Input 2

`40`

#### Sample Output 2

`6`

#### Explanation for Sample 2

The only valid numbers are , , , , and .

## Comments

Anyone got a faster way for python?