package main import ( "bufio" "fmt" "os" "strconv" ) func main() { scanner := bufio.NewScanner(os.Stdin) scanner.Split(bufio.ScanWords) var a, b, c, d, e int scanner.Scan() a, _ = strconv.Atoi(scanner.Text()) scanner.Scan() b, _ = strconv.Atoi(scanner.Text()) scanner.Scan() c, _ = strconv.Atoi(scanner.Text()) scanner.Scan() d, _ = strconv.Atoi(scanner.Text()) scanner.Scan() e, _ = strconv.Atoi(scanner.Text()) ans := 0 tmp := d for i := 1; i <= a*(b-c); i++ { if i%10 == 0 && e <= tmp { tmp -= e } ans += tmp } fmt.Println(ans) }