import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long sumOfGroup(int k) { // Return the sum of the elements of the k'th group. /* which number of the sequence do i start at? if k == 1, then i get the first num k == 2, i get the 2 num k == 3, i get the 4th num k == 4, start at 7th (k-1) + (k-2) + 1, plus another one this is (k-1)(k)/2 + 1 the actual number i start at is double this, then minus one or take out the plus one and add it after the doubling */ /* long sum = 0; long currNum = (k-1) * k + 1; for (int i = 0; i < k; i++, currNum += 2) { sum += currNum; } return sum; ok so that was pretty good, but i can do better once i have the starting number, i can calculate the average number and then multiply by k if there are 2 numbers in the set, i get the average by adding 1 if 3 numbers, average by adding 2 add k-1 to get the average */ return (long)k * k * k; //return (long)((k-1) * k + k) * (long)k; } public static void main(String[] args) { Scanner in = new Scanner(System.in); int k = in.nextInt(); long answer = sumOfGroup(k); System.out.println(answer); in.close(); } }