var
  n, g, r, tg, i, a : integer;
  t : integer;
begin
  reset(input, 'trafficjam.in');
  rewrite(output, 'trafficjam.out');
  read(n, g, r);
  t := 0;
  tg := 0;
  for i := 1 to n do begin
    read(a);
    if (tg + a <= g) then begin
      tg := tg + a;
    end else begin
      t := t + g + r;
      tg := a;
    end;
  end;
  writeln(t + tg);
end.