250-like Number

AtCoder
IDabc250_d
Time2000ms
Memory256MB
Difficulty
Let us regard an integer $k$ as "similar to $250$" if the following condition is satisfied: * $k$ is represented as $k=p \times q^3$ with primes $p<q$. How many integers less than or equal to $N$ are "similar to $250$"? ## Constraints * $N$ is an integer between $1$ and $10^{18}$ (inclusive) ## Input Input is given from Standard Input in the following format: $N$ [samples]
Samples
Input #1
250
Output #1
2

*   $54 = 2 \times 3^3$ is "similar to $250$".
*   $250 = 2 \times 5^3$ is "similar to $250$".

The two integers above are all the integers "similar to $250$".
Input #2
1
Output #2
0
Input #3
123456789012345
Output #3
226863
API Response (JSON)
{
  "problem": {
    "name": "250-like Number",
    "description": {
      "content": "Let us regard an integer $k$ as \"similar to $250$\" if the following condition is satisfied: *   $k$ is represented as $k=p \\times q^3$ with primes $p<q$. How many integers less than or equal to $N$ ",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc250_d"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Let us regard an integer $k$ as \"similar to $250$\" if the following condition is satisfied:\n\n*   $k$ is represented as $k=p \\times q^3$ with primes $p<q$.\n\nHow many integers less than or equal to $N$ ...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments