defmodule Main do def main do IO.read(:line) |> String.trim() |> String.split() |> Enum.map(&String.to_integer/1) |> solve |> IO.puts() end def solve(a) do a |> Enum.map(fn b -> x = b |> rem(3) == 0 y = b |> rem(5) == 0 cond do x || y -> cond do x -> 4 true -> 0 end + cond do y -> 4 true -> 0 end true -> b |> to_string |> String.length() end end) |> Enum.sum() end end