def f(lst)
  lst.chunk{|n|
    n == 0 ? :_separator : :num
  }.map{|_, seq|
    seq.inject(0, &:+)
  }
end