program t integer::a(100),b,c(100),i read(*,*)b a(1)=0 c=0 do i=1,100 a(i)=a(i)+1 c(i)=a(i)+c(i) if (a(i)==b) exit end do write(*,*)c(b) end program t