def czy_pierwsza(n):
d = 2
while d * d <= n:
if n % d == 0:
return False
d += 1
return True
def pierwsza(n):
numer = 0
i = 2
while numer != n:
if czy_pierwsza(i):
numer += 1
i += 1
return i - 1
print (pierwsza(7))
print (pierwsza(25))
ZGVmIGN6eV9waWVyd3N6YShuKToKCWQgPSAyCgl3aGlsZSBkICogZCA8PSBuOgoJCWlmIG4gJSBkID09IDA6CgkJCXJldHVybiBGYWxzZQoJCWQgKz0gMQoJcmV0dXJuIFRydWUKZGVmIHBpZXJ3c3phKG4pOgoJbnVtZXIgPSAwCglpID0gMgoJd2hpbGUgbnVtZXIgIT0gbjoKCQlpZiBjenlfcGllcndzemEoaSk6CgkJCW51bWVyICs9IDEKCQlpICs9IDEKCXJldHVybiBpIC0gMQpwcmludCAocGllcndzemEoNykpCnByaW50IChwaWVyd3N6YSgyNSkp