import java.util.Scanner object P480 extends App { val sc = new Scanner(System.in) val n = sc.nextInt() println(sum(n)) def sum(n: Int): Int = n match { case 0 => 0 case _ => n + sum(n - 1) } }