Problem K. B-number

时间限制 1 ms   内存限制 32 MB

A wqb-number, or B-number for short, is a non-negative integer whose decimal form contains the sub- string "13" and can be divided by 13. For example, 130 and 2613 are wqb-numbers, but 143 and 2639 are not. Your task is to calculate how many wqb-numbers from 1 to n for a given integer n.
 

输入数据

Process till EOF. In each line, there is one positive integer n(1 <= n <= 1000000000).
 

输出数据

Print each answer in a single line.
 

样例输入

复制
13
100
200
1000

样例输出

复制
1
1
2
2

提交

请先 登录

© 2025 FAQs Contact About