x = int(input("Enter the number upto which prime numbers should be printed :"))
print(x)

if x < 2 :
    print("Wrong input")
else :
    print("The prime numbers are :")
    print(2)
    for y in range (3 , x + 1):
        for i in range (2 , y):
            if (y % i) == 0:
                break
        else :
            print(y)
