import javax.swing.*; // program uses class Scanner

public class BPIH4E1B
{
     // main method begins execution of Java application
     public static void main( String args[] )
     {           
        int number1; // first number to add      
        int sum=0; // sum of number1 and number2
        number1=Integer.parseInt(JOptionPane.showInputDialog("Enter first integer: ")); // read number
        for(int i=1;i<=number1;i++)    
        { sum += i; // add numbers
        } 
        System.out.printf( "Sum is %d\n", sum ); // display sum
     } // end method main

} // end class BPIH4E1
