ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Разделы > Unsorted > задача:


50266 - Kovrov

Гость
• Обсуждение задачи (1)

Задачи раздела

• 50251 - Symmetric matrix
• 50252 - Birthday
• 50239 - Eating cheese
• 50244 - Chessboard Pattern
• 50245 - Santa Gifts
• 50256 - Sequence
• 50257 - Galls village
• 50280 - Division
• 50266 - Kovrov
• 50254 - Lawyers Council
• 50260 - What about judges?
• 50259 - Many-coloured roads
• 50276 - Nice Floor
• 50270 - Bitsorting
• 50272 - Strange Numbers
• 50275 - Wedding
• 50273 - Two Captains

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Автор: Павел Кузнецов, ПГУ.

Kovrov celebrates its anniversary at 1st September, because in 1778 in that day empress Catherine the Great issued the decree about foundation of Kovrov district and the town itself.

In this problem you have to find amount of all positive numbers between 1 and N such that they contain at least one '1' digit, two '7' digits and one '8' digit in decimal notation. I.e. you can get enough digits from the number to write down 1778.

Input
The first line contains a single number N (1 ≤ N ≤ 1000000).
Output
Output a single integer number - the answer for the problem.

Input 1 Output 1
1000
0
Input 2 Output 2
5000
3

Для отправки решений необходимо выполнить вход.

www.contester.ru