/*
 * REPETITION (for loop, counter-controlled): same flowchart shape as a while loop.
 *   int i = 1   -> process box before the decision (runs once)
 *   i <= n      -> the decision
 *   i++         -> process box at the end of the body, then back to the decision
 *
 * Flowchart:
 *   (Start)
 *     -> /Input n/
 *     -> [sum = 0, i = 1]
 *     -> <i <= n?> <------------------+
 *          True  -> [sum = sum + i]   |
 *                -> [i++] ------------+
 *          False -> /Print sum/ -> (End)
 */
import java.util.Scanner;

public class SumFor {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        System.out.print("Sum from 1 to: ");
        int n = sc.nextInt();

        int sum = 0;
        for (int i = 1; i <= n; i++) {
            sum = sum + i;
        }

        System.out.println("Sum = " + sum);
        sc.close();
    }
}
