<reponame>AAlab1819/NoachTjahjadi-01082170008
n = int(input())
times = n
for i in range(1,n): #for loop from 1 to n
    times = times + (n-i)*i #the formula

print(times)

n = int(input())
times = n
for i in range(1,n): #for loop from 1 to n
    times = times + (n-i)*i #the formula

print(times)
#for loop from 1 to n #the formula