defmodule Main do def main do n = IO.gets("") |> String.trim |> String.to_integer Enum.reduce(1..n, 0, fn _x, acc -> sum(acc) end) |> IO.puts end def sum(acc) do n = IO.gets("") |> String.trim |> String.to_integer acc + n end end