# Total mass of N balls
N = 100 # no. of balls
M = 0 # partial sum, which becomes total mass
i=0 # ball counter
while i < N: # repeat N times
m = i # m_i (mass of i-th ball)
M += m # i.e. M=M+m ( add m_i to partial sum )
i += 1 # i.e. i=i+1 ( increase ball counter )
print(M)