import math, time
print("""Input the number of unique possibilities to determine the average amount of times until there will be a repeat.
For example for a dice you would input 6, playing cards would be 52.
Might start taking awhile after a few thousand.""")
while True:
n = int(input())
start = time.time()
fac = math.factorial(n)
prob = 0
trigger = False
for r in range(2, n+2):
solution = r*((fac*(r-1))/(math.factorial(n-r+1)*(n**r)))
if solution < .0001 and trigger == True:
break
if solution > .0001:
trigger = True
prob += solution
print("Average of " + str(prob) + " times until first repeat")
print("Time to finish: " + str(time.time()-start) + " seconds")
print("")
print("Input another one")