defmodule Main do def main do input = IO.binread(:all) sum = to_charlist(input) |> Stream.filter(&(48 <= &1 and &1 <= 57)) |> Stream.map(&(String.to_integer(<<&1>>))) |> Enum.sum IO.puts sum end end