n=int(input()) work=1 ans=0 while work