defisprime(num): if num < 2: returnFalse for i inrange(2, int(num**0.5) + 1): if num % i == 0: returnFalse returnTrue
n = int(input()) nums = [] tag = 0 n = n + 1 whileTrue: iflen(nums) == 2: break if isprime(n): if tag == 0: nums.append(n) tag = 1 else: nums.append(n) n += 1 print(sum(nums)) # print(nums)
defisPrime(num): if num < 2: returnFalse for i inrange(2, int(num**0.5) + 1): if num % i == 0: returnFalse returnTrue
if __name__ == '__main__': n = int(input()) zhishu = 0 heshu = 0 k = n + 1 whileTrue: if isPrime(k): zhishu = k break k = k + 1 k = n + 1 whileTrue: ifnot isPrime(k): heshu = k break k = k + 1 print(zhishu + heshu)