a,b,c,d=gets.split.map &:to_i if d<10 then z=0 (b+a).times{|i| z+=(i