Problem:
Score : 100 points

Problem Statement

There are N children in AtCoder Kindergarten. Mr. Evi will arrange the children in a line, then give 1 candy to the first child in the line, 2 candies to the second child, ..., N candies to the N-th child. How many candies will be necessary in total?

Constraints

1≦N≦100

Input

The input is given from Standard Input in the following format:

N

Output

Print the necessary number of candies in total.

Sample Input 1

3

Sample Output 1

6

The answer is 1+2+3=6.

Sample Input 2

10

Sample Output 2

55

The sum of the integers from 1 to 10 is 55.

Sample Input 3

1

Sample Output 3

1

Only one child. The answer is 1 in this case.

Solution in PHP (5.6.30) (judge verdict: Wrong Answer)

<?php
function checkIsUnbalance($string, $string_check) {
	$result['value'] = false;
	$num_length = strlen($string_check);
	for ($i = 0; $i < $num_length; $i++) {
		$char = $string_check[$i];
		if (substr_count($string_check, $char) > ($num_length/2)) {
			$result['value']    = true;
			$result['position'] = strpos($string, $char) + 1;
			return $result;
		}
	}
	return false;
}

fscanf(STDIN, "%s", $string);
$array_sub_string = array();
$array_char = array();
$length = strlen($string);
for ($i = 0; $i < $length; $i++) {
    $array_char[] = $string[$i];
}

$count_letter = count($array_char);
for ($i = 0; $i < $count_letter; $i++) {
	unset($array_char[$i]);
	if (count($array_char) >= 2) {
		$array_sub_string[] = implode("", $array_char);
	}
}

$count_sub_string = count($array_sub_string);
$has_unbalance = false;
for ($i = 0; $i < $count_sub_string; $i++) {
	$result = checkIsUnbalance($string, $array_sub_string[$i]);
	if ($result['value']) {
		$has_unbalance = true;
		echo $result['position'] . " " . $length;
		return;
	}
}

if (!$has_unbalance) {
	echo "-1 -1 ";
}

?>