[信息与未来 2016] 幸运数字

Luogu
IDLGB4137
Time1000ms
Memory128MB
DifficultyP1
2016江苏枚举信息与未来
小明认为,如果以下条件之一成立,则正整数 $x$ 就是一个幸运数字: 1. $x$ 是 $4$ 的倍数。 1. $x$ 是 $7$ 的倍数。 1. $x$ 转换为字符串后,包含子串 `44` 或 `77`。 例如,$105$($7$ 的倍数)、$442$(包含`44`)、$1284$($4$ 的倍数)都是幸运数字,而 $474$ 则不是。编程统计 $1$ 到 $n$ 中幸运数字的数量。 ## Input 一行,一个整数 $n$。 ## Output 一行,一个整数,$1,2,3,\dots n$ 中幸运数字的数量。 [samples] ## Note 对于 $100\%$ 的数据,$1\le n\leq 10^6$。 >本题原始满分为 $10\text{pts}$。
Samples
Input #1
32
Output #1
11
Input #2
987654
Output #2
406754
API Response (JSON)
{
  "problem": {
    "name": "[信息与未来 2016] 幸运数字",
    "description": {
      "content": "小明认为,如果以下条件之一成立,则正整数 $x$ 就是一个幸运数字: 1. $x$ 是 $4$ 的倍数。 1. $x$ 是 $7$ 的倍数。 1. $x$ 转换为字符串后,包含子串 `44` 或 `77`。 例如,$105$($7$ 的倍数)、$442$(包含`44`)、$1284$($4$ 的倍数)都是幸运数字,而 $474$ 则不是。编程统计 $1$ 到 $n$ 中幸运数字的数量。",
      "description_type": "Markdown"
    },
    "platform": "Luogu",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 131072
    },
    "difficulty": {
      "LuoguStyle": "P1"
    },
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "LGB4137"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "小明认为,如果以下条件之一成立,则正整数 $x$ 就是一个幸运数字:\n\n1. $x$ 是 $4$ 的倍数。\n1. $x$ 是 $7$ 的倍数。\n1. $x$ 转换为字符串后,包含子串 `44` 或 `77`。\n\n例如,$105$($7$ 的倍数)、$442$(包含`44`)、$1284$($4$ 的倍数)都是幸运数字,而 $474$ 则不是。编程统计 $1$ 到 $n$ 中幸运数字的数量。\n\n##...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments