import java.io.*;

public class ForExample

{

	public static void main ( String args[])throws IOException 

	{

		//uses a for loop to ass the squares if the first N numbers togeter.
		//will read n from the user 

		int n;
		int sum;
		int count;// to count the for loop
		//sets up input stream to read in numbers

		//creat a bufferreader object to read the InputStreamReader

		BufferedReader in = new BufferedReader( new InputStreamReader(System.in));
		String s = new String();

		sum = 0;
		System.out.println("Enter the number of integers to be added");
		System.out.flush();

		s=in.readLine(); // Reads in the users input

		n = Integer.parseInt(s); // Convert to integer and assign it to n

		//statement repeated n+1 times

		for (count=0;count<=n;count++)
		sum = sum + count*count;

		System.out.println("You have asked for the sum of te sqaures of the first " +n+" numbers");
		System.out.println("The total is = " +sum);
	}//ends the main

}//ends the class