#P1590. Counting Pascal Numbers
Counting Pascal Numbers
Counting Pascal Numbers
Ancient Pascal people used Arabic numerals for counting but despised the digit \(7\) because it was considered unlucky. As a result, their numeral system skips \(7\). For example, the Pascal numeral 8 actually represents the natural number \(7\), and 18 represents \(16\). In other words, a Pascal Number is a natural number whose decimal representation does not contain the digit \(7\). Given a positive integer \(n\), your task is to count how many Pascal numbers exist within the range \([1, n]\).
Note: All mathematical expressions are written in \(\LaTeX\) format.
inputFormat
The input consists of a single line containing a positive integer \(n\).
outputFormat
Output a single integer representing the count of Pascal numbers in the range \([1, n]\).
sample
20
18