namespace CalculateSumN
{
#region using direction
using System;
using System.Collections.Generic;
#endregion
class Program
{
static void Main(string[] args)
{
Dictionary<Int32, Int32> result = new Dictionary<Int32, Int32>();
var input = Console.ReadLine();
while (input != null)
{
Int32 param = -1;
if (Int32.TryParse(input, out param) == true)
{
Int32 sum = 0;
if (result.ContainsKey(param) == true)
{
sum = result[param];
}
else
{
for (Int32 flag = 0; flag <= param; flag++)
{
sum += flag;
}
result[param] = sum;
}
Console.WriteLine(sum);
Console.WriteLine();
}
input = Console.ReadLine();
}
}
}
}