using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int[] NList => ReadLine().TrimStart().Split().Select(int.Parse).ToArray(); static int[] NMi => ReadLine().Split().Select(c => int.Parse(c) - 1).ToArray(); static int[][] NMap(int n) => Enumerable.Repeat(0, n).Select(_ => NMi).ToArray(); public static void Main() { Solve(); } static void Solve() { var p = NList; var (a, b, c, d, e) = (p[0], p[1], p[2], p[3], p[4]); WriteLine(Math.Max(a - b, a - b + c * (d - e))); } }