





import os
import string
import sys


UpperCamelCase__											= 1 << 8

UpperCamelCase__											= {
    "tab": ord("\t"),
    "newline": ord("\r"),
    "esc": 27,
    "up": 65 + ARROW_KEY_FLAG,
    "down": 66 + ARROW_KEY_FLAG,
    "right": 67 + ARROW_KEY_FLAG,
    "left": 68 + ARROW_KEY_FLAG,
    "mod_int": 91,
    "undefined": sys.maxsize,
    "interrupt": 3,
    "insert": 50,
    "delete": 51,
    "pg_up": 53,
    "pg_down": 54,
}

UpperCamelCase__											= KEYMAP["up"]
UpperCamelCase__											= KEYMAP["left"]

if sys.platform == "win32":
					UpperCamelCase__											= []
					UpperCamelCase__											= {
					    B"\xe0H": KEYMAP["up"] - ARROW_KEY_FLAG,
					    B"\x00H": KEYMAP["up"] - ARROW_KEY_FLAG,
					    B"\xe0P": KEYMAP["down"] - ARROW_KEY_FLAG,
					    B"\x00P": KEYMAP["down"] - ARROW_KEY_FLAG,
					    B"\xe0M": KEYMAP["right"] - ARROW_KEY_FLAG,
					    B"\x00M": KEYMAP["right"] - ARROW_KEY_FLAG,
					    B"\xe0K": KEYMAP["left"] - ARROW_KEY_FLAG,
					    B"\x00K": KEYMAP["left"] - ARROW_KEY_FLAG,
					}

for i in range(10):
					UpperCamelCase__											= ord(str(i))





def     _UpperCamelCase     ():






							"""simple docstring"""





							if os.name == "nt":
														import msvcrt

														UpperCamelCase__				     =			"""mbcs"""
														# Flush the keyboard buffer
														while msvcrt.kbhit():
																					msvcrt.getch()
														if len(a__       ) == 0:
																					# Read the keystroke
																					UpperCamelCase__				     =			msvcrt.getch()

																					# If it is a prefix char, get second part
																					if ch in (b"\x00", b"\xe0"):
																												UpperCamelCase__				     =			ch + msvcrt.getch()
																												# Translate actual Win chars to bullet char types
																												try:
																																			UpperCamelCase__				     =			chr(WIN_KEYMAP[cha]       )
																																			WIN_CH_BUFFER.append(chr(KEYMAP["""mod_int"""]       )       )
																																			WIN_CH_BUFFER.append(a__       )
																																			if ord(a__       ) in (
																																			    KEYMAP["insert"] - 1 << 9,
																																			    KEYMAP["delete"] - 1 << 9,
																																			    KEYMAP["pg_up"] - 1 << 9,
																																			    KEYMAP["pg_down"] - 1 << 9,
																																			):
																																										WIN_CH_BUFFER.append(chr(126       )       )
																																			UpperCamelCase__				     =			chr(KEYMAP["""esc"""]       )
																												except KeyError:
																																			UpperCamelCase__				     =			cha[1]
																					else:
																												UpperCamelCase__				     =			ch.decode(a__       )
														else:
																					UpperCamelCase__				     =			WIN_CH_BUFFER.pop(0       )
							elif os.name == "posix":
														import termios
														import tty

														UpperCamelCase__				     =			sys.stdin.fileno()
														UpperCamelCase__				     =			termios.tcgetattr(a__       )
														try:
																					tty.setraw(a__       )
																					UpperCamelCase__				     =			sys.stdin.read(1       )
														finally:
																					termios.tcsetattr(a__   ,			termios.TCSADRAIN   ,			a__       )
							return ch





def     _UpperCamelCase     ():






							"""simple docstring"""





							UpperCamelCase__				     =			get_raw_chars()
							if ord(a__       ) in [KEYMAP["interrupt"], KEYMAP["newline"]]:
														return char

							elif ord(a__       ) == KEYMAP["esc"]:
														UpperCamelCase__				     =			get_raw_chars()
														if ord(a__       ) == KEYMAP["mod_int"]:
																					UpperCamelCase__				     =			get_raw_chars()
																					if ord(a__       ) >= KEYMAP["arrow_begin"] - ARROW_KEY_FLAG and ord(a__       ) <= KEYMAP["arrow_end"] - ARROW_KEY_FLAG:
																												return chr(ord(a__       ) + ARROW_KEY_FLAG       )
																					else:
																												return KEYMAP["undefined"]
														else:
																					return get_raw_chars()

							else:
														if char in string.printable:
																					return char
														else:
																					return KEYMAP["undefined"]











import math





def     _UpperCamelCase     (a__   :int       ):






							"""simple docstring"""





							UpperCamelCase__				     =			[True] * n
							UpperCamelCase__				     =			False
							UpperCamelCase__				     =			False
							UpperCamelCase__				     =			True

							for i in range(3   ,			int(n**0.5 + 1       )   ,			2       ):
														UpperCamelCase__				     =			i * 2
														while index < n:
																					UpperCamelCase__				     =			False
																					UpperCamelCase__				     =			index + i

							UpperCamelCase__				     =			[2]

							for i in range(3   ,			a__   ,			2       ):
														if is_prime[i]:
																					primes.append(a__       )

							return primes





def     _UpperCamelCase     (a__   :int = 9999_6666_3333       ):






							"""simple docstring"""





							UpperCamelCase__				     =			math.floor(math.sqrt(a__       )       ) + 100
							UpperCamelCase__				     =			prime_sieve(a__       )

							UpperCamelCase__				     =			0
							UpperCamelCase__				     =			0
							UpperCamelCase__				     =			primes[prime_index]

							while (last_prime**2) <= limit:
														UpperCamelCase__				     =			primes[prime_index + 1]

														UpperCamelCase__				     =			last_prime**2
														UpperCamelCase__				     =			next_prime**2

														# Get numbers divisible by lps(current)
														UpperCamelCase__				     =			lower_bound + last_prime
														while upper_bound > current <= limit:
																					matches_sum += current
																					current += last_prime

														# Reset the upper_bound
														while (upper_bound - next_prime) > limit:
																					upper_bound -= next_prime

														# Add the numbers divisible by ups(current)
														UpperCamelCase__				     =			upper_bound - next_prime
														while current > lower_bound:
																					matches_sum += current
																					current -= next_prime

														# Remove the numbers divisible by both ups and lps
														UpperCamelCase__				     =			0
														while upper_bound > current <= limit:
																					if current <= lower_bound:
																												# Increment the current number
																												current += last_prime * next_prime
																												continue

																					if current > limit:
																												break

																					# Remove twice since it was added by both ups and lps
																					matches_sum -= current * 2

																					# Increment the current number
																					current += last_prime * next_prime

														# Setup for next pair
														UpperCamelCase__				     =			next_prime
														prime_index += 1

							return matches_sum


if __name__ == "__main__":
					print(solution())




