c, d = map(int, input().split())
n, m = map(int, input().split())
k = int(input())

s = max(n * m - k, 0)
res = 0
while s:
    if c > min(s, n) * d:
        res += min(s,n) * d
    else:
        res += c
    s -= min(s,n)
print(res)

c,d = [int(x) for x in raw_input().split()]
n,m = [int(x) for x in raw_input().split()]
k = int(raw_input())

ans = 0
total = n*m - k;
total = 0 if (total < 0) else total

fac = total/n
ans = min(fac*c + (total - fac*n)*d,(fac+1)*c)
ans = min(ans,total*d)

print ans

c, d = map(int, raw_input().split())
n, m = map(int, raw_input().split())
k = int(raw_input())

problems = 0
people = n * m - k

while people > 0:
    if (d < float(c) / n) or (d < float(c) / people):
        people -= 1
        problems += d
    else:
        people -= n
        problems += c
print problems

# Author:   Gilberto A. dos Santos
# Website:  http://codeforces.com/contest/417/problem/0

c, d = map(int, raw_input().split(" "))
n, m = map(int, raw_input().split(" "))
k = int(raw_input())

needed = (n * m) - k

numberOfProblems = 0
while needed > 0:
    if needed >= n:
        costAdd = d * n
        numberOfProblems += costAdd if costAdd < c else c
        needed -= n
    else:
        costAdd = d * needed
        numberOfProblems += costAdd if costAdd < c else c
        needed -= n

print numberOfProblems

c,d = map(int,raw_input().split())
n,m = map(int,raw_input().split())
k = int(raw_input())
need = m * n - k
main_need = c/float(n)
add_need = d
if need <= 0 :
	print 0
else :
	if add_need <= main_need :
		print add_need * need
	else :
		s = c * ( need / n )
		last_need = need % n
		if c <= add_need * last_need :
			print s + c
		else :
			print s + add_need * last_need

import sys,math

if __name__ == '__main__':
	[c,d] = map(int,sys.stdin.readline().split())
	[n,m] = map(int,sys.stdin.readline().split())
	k = int(raw_input())
	minimum = n*m - k
	if minimum <= 0:
		print 0
	else:
		one = minimum / n * c + (c if minimum % n != 0 else 0)
		two = minimum / n * c + minimum % n * d
		three = minimum * d
		print min(one,two,three)

c, d = map(int, raw_input().split())
n, m = map(int, raw_input().split())
k = int(raw_input())

res = m * c
p = n * m - k

for i in range(m+1):
	for j in range(n * m + 1):
		if i * n + j >= p: res = min(res, c * i + d * j)

print res

# coding=utf-8
'''
http://codeforces.ru/contest/417/problem/A

A. Отбор
ограничение по времени на тест 1 секунда
ограничение по памяти на тест 256 мегабайт
ввод стандартный ввод
вывод стандартный вывод
Финалистами соревнований «Russian Code Cup» в 2214 году будут участники, ставшие победителями в одном из отборочных раундов.

Отборочные раунды делятся на основные и дополнительные. Каждый из основных отборочных раундов должен состоять из c задач, а победителями раунда считаются n человек, занявшие первые места в этом раунде. Каждый из дополнительных отборочных раундов состоит из d задач. Победителем дополнительного раунда становится один человек. Кроме этого, на финал без конкурса приглашаются k победителей финалов прошлых лет.

В результате всех отборочных раундов в финал должно пройти не менее n*m человек. Каким образом нужно организовать отборочные раунды, чтобы в результате всех отборочных раундов в финал прошли не менее n·m человек, а при этом суммарное количество использованных в раундах задач было как можно меньше?

Входные данные
Первая строка содержит два целых числа c и d (1<=c,d<=100) — количество задач в основном и дополнительном раундах соответственно. Вторая строка содержит два целых числа n и m (1<=n,m<=100). Наконец, третья строка содержит целое число k (1<=k<=100) — число заранее отобранных победителей.

Выходные данные
В первой строке выведите единственное целое число — минимальное количество задач, которое нужно подготовить членам жюри.
'''

from __future__ import division
import math

c, d = map(lambda x: int(x), raw_input().split())
n, m = map(lambda x: int(x), raw_input().split())
k = int(raw_input())

# минимальное количество финалистов из победителей отборочных раундов
p = n*m - k

if p > 0:
	res = -1
	# цикл по количеству основных раундов
	for i in range(int(math.ceil(p/n)) + 1):
		# количество дополнительных раундов
		j = p - n*i
		if j < 0:
			j = 0
		# количество задач при i основных и j дополнительных раундах
		z = c*i + d*j
		#print i, j, z
		if res < 0 or z < res:
			res = z
else:
	res = 0

print res

c, d = map(int, raw_input().split())
n, m = map(int, raw_input().split())
k = int(raw_input())

needed = n * m - k

if needed <= 0:
	print 0
else:
	print min((needed / n + 1) * c, (needed / n) * c + (needed % n) * d, needed * d)

import sys
l=[]
for i in sys.stdin:
    l+=[int(k) for k in i.rstrip().split()]

c,d,n,m,k=l[0],l[1],l[2],l[3],l[4]

if n*m<=k:
    print 0
else:
    v=[d*i for i in range(n*m-k+1)] #quest

    for i in range(n,len(v)):
        v[i]=min([v[i-n]+c,v[i-1]+d])

    for i in range(n):
        if len(v)-i-1<0:
            break
        v[-1]=min([v[-1-i]+c,v[-1]])
    print v[-1]

c, d = map(int, raw_input().split(" "))
n, m = map(int, raw_input().split(" "))
k = input()
t = (n * m) - k
if t < 1:
    print 0
else:
    p = []
    a = t/n
    if t % n != 0:
        p.append((a * c) + (d * (t % n)))
        a += 1
    p.append(a*c)
    p.append(d*t)
    print min(p)

c,d = [int(x) for x in raw_input().split()]
n,m = [int(x) for x in raw_input().split()]
k = int(raw_input())
probs = 0
go = d
add = 1
if float(c)/n < float(d):
    go = c
    add = n

while 1:

    if k >= m*n:
        break
    if k + 1 == m*n:
        probs += min(c,d)
        break
    elif k + n >= m*n:
        probs += min(c, (m*n - k)*d)
        break
    else:
        k+=add
        probs+=go
print probs

memo=[]

def go(tot,n,c,d):
    if tot<=0:
        return 0
    elif memo[tot]<1000000007:
        return memo[tot]
    else:
        memo[tot]=min(go(tot-n,n,c,d)+c,go(tot-1,n,c,d)+d)
        return memo[tot]

c,d=raw_input().split()
n,m=raw_input().split()
k=raw_input()

c=int(c)
d=int(d)
n=int(n)
m=int(m)
k=int(k)

tot=n*m-k
for i in range(0,tot+1):
    memo.append(1000000007)

ans=go(tot,n,c,d)
print ans

c,d=[int(x) for x in raw_input().split()]
n,m=[int(x) for x in raw_input().split()]
k=int(raw_input())
ans=min((n*m-k+n-1)/n*c,(n*m-k)/n*c+(n*m-k)%n*d,(n*m-k)*d)
print ans if ans>=0 else 0

from math import ceil
c,d=map(int,raw_input().split())
n,m=map(int,raw_input().split())
ans=10**10
k=int(input())
for i in range(0,m+2):
    j=n*m-k-(i*n)
    if j>0:
        ans=min(i*c+j*d,ans)
    else:
        ans=min(i*c,ans)
print ans

c,d = map(int,raw_input().strip().split())
n,m = map(int,raw_input().strip().split())
k = int(raw_input())

##c = 100
##d = 1
##n = 2
##m = 3
##k = 1

task_count = 0
rounds_c = 0
rounds_d = 0
minamount = n*m-k
if (minamount <= 0):
    task_count = 0
else:
    cost_c = float(n*1.0/c)
    cost_d = float(1*1.0/d)
    if cost_c>cost_d:
        ost = minamount % n
        if ost == 0:
            task_count = (minamount / n)*c
        else:
            rounds_c = minamount / n
            task_count = rounds_c * c
            if ost*d > c:
                task_count += c
            else:
                task_count += ost*d
    else:
        task_count = (minamount / 1)*d

print task_count

num = raw_input().strip().split(" ")
c, d = int(num[0]), int(num[1])
num = raw_input().strip().split(" ")
n, m = int(num[0]), int(num[1])
k = int(raw_input())
total = n * m
need = total - k
prob = 0
while need > 0:
    if n <= need:
        if c < d * n:
            need -= n
            prob += c
        else:
            need -= 1
            prob += d
    else:
        if c < d * need:
            prob += c
        else:
            prob += d * need
        need = 0
print prob

#############################  MAIN
c, d = map( int, raw_input().split() )
n, m = map( int, raw_input().split() )
k = int( raw_input() )
osn = c / n
needed = m*n - k
if needed <= 0:
    print 0
elif osn >= d:
    print needed*d
else:
    osnrounds = needed / n
    needed  = needed % n
    if d*needed < c:
        print osnrounds*c + d*needed
    else:
        print (osnrounds+1)*c

c,d = [int(item) for item in raw_input().split(' ')]
n,m = [int(item) for item in raw_input().split(' ')]
k = int(raw_input())
for i in range(0, m + 1):
    x = i
    if x * n + k >= m * n:
        y = 0
    else:
        y = m * n - k - n * x
    ans = c * x + d * y
    if i == 0:
        mx = ans
        continue
    mx = ans if mx > ans else mx
print mx

c, d = map ( int, raw_input ( ).split ( ) )
n, m = map ( int, raw_input ( ).split ( ) )
k = int(raw_input ( ) )

rem = n*m - k
minAns = 1e10

for i in range(10000):
    for j in range(10000):
        if ( i * n + j >= rem ):
             if ( minAns > i * c + j * d):
                minAns = i * c + j * d
             break

print minAns

c,d = raw_input().split()
n,m = raw_input().split()
c,d = int(c), int(d)
n,m = int(n), int(m)
k = int(raw_input())

outp = 1000000000

for i in range(1000000):
	if((n*m-k-n*i)<0):
		outp=min(outp,c*i)
	else:
		outp=min(outp,(n*m-k-n*i)*d+i*c)

print outp

c,d = list(map(int,input().split()))
n,m = list(map(int,input().split()))
k = int(input())
t = max((m*n)-k,0)
p = min(c,n*d)
ans = p*(t//n)
rem = t%n
ans = ans+min(c,rem*d)
print(ans)

import sys

c, d = map(int, sys.stdin.readline().split())
n, m = map(int, sys.stdin.readline().split())
k = int(sys.stdin.readline())

total = n * m - k
if total <= 0:
  print(0)
  sys.exit(0)

a = [d*i for i in range(0, total+1)]

for i in range(1, total+1):
  if i <= n:
    if a[i] > c:
      a[i] = c
  else:
    if a[i-n] + c < a[i]:
      a[i] = a[i-n] + c

print( a[total] )

input = raw_input
c, d = map(int, input().split())
n, m = map(int, input().split())
k = int(input())

s = n*m - k
res = 0

if s > 0:
    if (c/n) > d:
        res += d*s
    else:
        os = s - (s // n) * n
        res += (s // n) * c
        if c < d*os:
            res += c
        else:
            res += d*os

print( res )

import math
def ar():
    return map(int,raw_input().split())
c,d=ar()
n,m=ar()
k=ar()[0]
req=(n*m)-k
mi=100000000
for i in range(req/n + n):
    for j in range(req+3):
        if n*i+j >=req:
            if c*i+j*d<mi:
                mi=i*c+j*d
if mi==100000000:
    mi=0
print mi

import math
c,d=map(int,input('').split())
n,m=map(int,input('').split())
k=int(input(''))
if n*m-k<0:
    print('0')
    exit()
if 1/d>n/c:    print((n*m-k)*d)
else:
    if (math.ceil((n*m-k)/n)*c)<((n*m-k)//n)*c+((n*m-k)%n)*d: print (math.ceil((n*m-k)/n)*c)
    else: print(((n*m-k)//n)*c+((n*m-k)%n)*d)

problems = input().split()
c = int(problems[0])
d = int(problems[1])
n_m = input().split()
n = int(n_m[0])
m = int(n_m[1])
k = int(input())

t = n * m - k # нужное воличество людей, кроме уже прошедших
ans = 100000000  # количество задач
i = 0
while i*n <= t: # если число проходящих по основным раундам не больше, чем надо
    ans = min(ans, (t - i*n) * d + i*c)
    i += 1
ans = min(ans, i*c)
print(ans)

import math
def ar():
    return map(int,raw_input().split())
c,d=ar()
n,m=ar()
k=ar()[0]
req=(n*m)-k
if req<0:
    req=0
mi=100000000
for i in range(req/n + n):
    for j in range(req+3):
        if n*i+j >=req:
            if c*i+j*d<mi:
                mi=i*c+j*d
print mi

#import sys
#sys.stdin = open('input.txt','r')
c, d = map(int, input().split())
n, m = map(int, input().split())
k = int(input())
L = 10001
for f in range(m + 1):
	for g in range(n * m + 1):
		if f * n + g + k >= n * m:
			L = min(L, f * c + g * d)
print(L)

from math import ceil

c, d = map(int, raw_input().split())
n, m = map(int, raw_input().split())
k = input()

def f(c, d, n, m, k):
    p = n*m - k
    if p <= 0: return 0
    #print p, d, n
    a = (
        p * d,
        int(ceil(float(p)/n)) * c,
        (p/n) * c + (p%n) * d
    )
    #print a
    return min(a)
print f(c, d, n, m, k)

[c, d], [n, m], k = map(int, input().split()), map(int, input().split()), int(input())
left = n * m - k
if left <= 0:
    print(0)
else:
    print(min(left // n * c + left % n * d, (left + n - 1) // n * c, left * d))

c,d=map(int,input().split())

n,m=map(int,input().split())

k=int(input())

z=0
best=10**10
while(1):
    x=n*m-k
    x-=z*n
    best=min(best,z*c+(max(x,0)*d))
    if(x<0):
        break
    z+=1
print(best)

vals = [int(x) for x in raw_input().split()]
a=vals[0]
b=vals[1]
vals = [int(x) for x in raw_input().split()]
n=vals[0]
m=vals[1]
k=input()

t=n*m-k
r=0

while t>0:
    if a<min(n,t)*b:
        t-=n
        r+=a
    else:
        t-=1
        r+=b

print(r)

'''
Created on Apr 17, 2014

@author: Arjun
'''
stuff = raw_input()
stuff2 = raw_input()
autoAdvance = int(raw_input())
lista = stuff.split()
listb = stuff2.split()
mainRound = int(lista[0])
extraRound = int(lista[1])
mainAdvance = int(listb[0])
m = int(listb[1])
needAdvance = mainAdvance*m-autoAdvance
val = 0
if(needAdvance%mainAdvance == 0):
    divisor = needAdvance/mainAdvance
else:
    divisor = needAdvance/mainAdvance + 1

if(needAdvance<=0):
    print 0
elif(mainRound < extraRound):
    print mainRound*divisor
else:
    all2 = extraRound*needAdvance
    all1 = mainRound*divisor
    blah = (needAdvance/mainAdvance)*mainRound + (needAdvance - (needAdvance/mainAdvance)*mainAdvance)*extraRound
    print min(all1,all2,blah)

c,d = list(map(int, input().split(" ")))
n, m = list(map(int, input().split(" ")))
k = int(input())
mini = n*m-k
if mini < 1:
	print(0)
elif d * n <= c: # easier one at a time
	print(d*mini)
else:
	total = (mini // n) * c
	mini = mini % n
	total += min(c, d*mini)
	print(total)

c, d = map(int, raw_input().split(" "))
n, m = map(int, raw_input().split(" "))
k = int(raw_input())

mn = 10**9

all = n * m - k
if(all <= 0):
	mn = 0

for x in range(0, 1000):
	y = all - x * n
	cur = x * c
	if(y > 0):
		cur += y * d
	mn = min(mn, cur)
print(mn)

c, d = map(int, raw_input().split())
n, m = map(int, raw_input().split())
k = int(raw_input())
all = n * m - k
if(all <= 0): print 0
else: print min((all/n + 1) * c, (all / n) * c + (all % n) * d, all * d)

c,d=[int(x) for x in raw_input().split()]
n,m=[int(x) for x in raw_input().split()]
k=int(raw_input())
ans=min((n*m-k+n-1)/n*c,(n*m-k)/n*c+(n*m-k)%n*d,(n*m-k)*d)
print ans if ans>=0 else 0

#c,d,n,m,k=map(int,input().split())
c, d = map(int, input().split())
n, m = map(int, input().split())
k = int(input())

# c и d (1 ≤ c, d ≤ 100)  количество задач в основном и дополнительном раундах
# n и m (1 ≤ n, m ≤ 100) n победителей
# k (1 ≤ k ≤ 100) — число заранее отобранных победителей

S = 0
if n*m>k :
    nub = n*m-k
    S = 100000000000
    S0 = S
    i=0
    while S0<=S and i<=int(nub/n+2):
        S = S0
        S0 = i*c + d*max(0, nub-n*i)
        #print(i,S,S0)
        i += 1

print(S)

#!/usr/bin/env python

import sys
import logging

c, d = map(int, raw_input().split())
n, m = map(int, raw_input().split())
k = input()

t = n * m - k

candidates = []

candidates += [c * (t / n + (1 if t%n != 0 else 0))]
candidates += [d * t]

candidates += [c * (t/n) + (t - n*(t/n)) * d]

print max(0, min(candidates))

c, d = map(int, input().split())
n, m = map(int, input().split())
k = int(input())
total = n * m - k
if k >= n * m:
  print(0)
elif c < d:
  if total % n == 0:
    print(((total // n)) * c)
  else:
    print(((total // n) + 1) * c)
else:
  nr = 0
  nn = (c / n)
  nm = d
  if nn < nm:
    #while (nr * n) + n < total:
    #  nr += 1
    nr = total // n
    npn = nr * c
    if nr * n < total:
      npn = (nr + 1) * c
    npm = nr * c + d * (total - nr * n)
    print(min(npn, npm))
  else:
    print(d * total)

c, d = map(int, raw_input().split())
n, m = map(int, raw_input().split())
k = int(raw_input())

x = n * m - k
case = 0

while x > 0:
    if n <= x:
        if c < d * n:
            x -= n
            case += c
        else:
            x -= 1
            case += d
    else:
        if c < d * x:
            case += c
        else:
            case += d * x
        x = 0

print case

c, d = map(int, input().split(' '))
n, m = map(int, input().split(' '))
k = int(input())
dp = [0] * 100000
need = n*m - k

if need <= 0:
    print(0)
    quit()

for i in range(1, 100000):
    dp[i] = min(dp[i-n]+c, dp[i-1]+d)

print(dp[need])

import math
x=raw_input().split(' ')
c=int(x[0])
d=int(x[1])
y=raw_input().split(' ')
n=int(y[0])
m=int(y[1])
pro=n*m
k=input()
pro=pro-k
if pro>0:
    if c<=d:
        ans=int(math.ceil(float(pro)/n))*c
    else:
        if float(n)/c>=float(1)/d:
            if pro%n==0:
                ans=(pro/n)*c
            else:
                ans=int(math.floor(float(pro)/n))*c
                am=pro%n
                if c<=am*d:
                    ans=ans+c
                else:
                    ans=ans+am*d
        else:
            ans=pro*d
    print ans
else:
    print "0"

c, d = list(map(int, input().split()))
n, m = list(map(int, input().split()))
f = n * m
k = int(input())
result = 0
uch = k

useosn = usedop = 0

while uch < f:
    if f-uch >= n:
        if c/n < d:
            result += c
            uch += n
        else:
            result += d
            uch += 1
    else:
        if c > (d*(f-uch)):
            while uch < f:
                result += d
                uch += 1
        else:
            result += c
            uch += n

print(max(0, result))

import sys, re

f = sys.stdin

c, d = map(int, f.readline().strip().split())
n, m = map(int, f.readline().strip().split())
k = int(f.readline().strip().split()[0])

need = n * m - k

if need <= 0:
    print 0
    exit(0)

result = sys.maxint
for x in xrange(need + 1):
    for y in xrange(need + 1):
        if x * n + y >= need:
            result = min(x * c + y * d, result)
    if x * n >= need:
        break

print result

c, d = map(int, input().split())
n, m = map(int, input().split())
p = 0
k = int(input())
if m*n <= k:
    print(0)
else:
    a = [0]*(m*n+1)
    #a[k+1] = min(c,d)
    for i in range(k+1,m*n+1):
        a[i] = min(a[i-n]+c, a[i-1]+d)
    print(a[m*n])

import math
mainProblems, additionalProblems = map(int, raw_input().split())
ratingListCount, m = map(int, raw_input().split())
prevWinners = int(raw_input())

totalPeople = ratingListCount * m

if prevWinners >= totalPeople:
    print 0
    exit()

requiredPeople = totalPeople - prevWinners
problemCount = 0

while requiredPeople > 0:
    if ratingListCount > requiredPeople:
        problemCount += min(mainProblems, requiredPeople * additionalProblems)
        requiredPeople = 0
    else:
        requiredPeople -= ratingListCount
        problemCount += min(mainProblems, ratingListCount * additionalProblems)

print problemCount

c, d = list(map(int, input().split()))
n, m = list(map(int, input().split()))
k = int(input())
kolvo = m * n - k
if kolvo < 0:
	print(0)
	exit()
print(min(c * (kolvo // n), d * n * (kolvo // n)) + min(c, d * (kolvo % n)))

def debug():
    c,d=map(int,raw_input().split())
    n,m=map(int,raw_input().split())
    k=input()
    final=n*m
    need=final-k
    if need<=0:
        print 0
    else:
        fp1=c/float(n)
        fp2=d
        if fp1<fp2:
            timu=(need/n)* c
            rest= need- (need/n)*n
            if rest:
                if rest*d > c:
                    print timu+c
                else:
                    print timu+rest*d
            else:
                print timu
        else:
            print need*d

debug()

def f(x, y): return x * c + y * d
c, d = map(int, input().split())
n, m = map(int, input().split())
k = n * m - int(input())
x, s = 0, max(0, k * d)
while k > x * n:
    t = f(x, k - x * n)
    if t < s: s = t
    x += 1
print(min(s, f(x, 0)))

# Made By Mostafa_Khaled
bot = True
c, d = list(map(int, input().split()))
n, m = list(map(int, input().split()))
k = int(input())
kolvo = m * n - k
if kolvo < 0:
	print(0)
	exit()
print(min(c * (kolvo // n), d * n * (kolvo // n)) + min(c, d * (kolvo % n)))

# Made By Mostafa_Khaled

x=raw_input().split()
y=raw_input().split()
z=raw_input().split()
c=int(x[0])
d=int(x[1])
n=int(y[0])
m=int(y[1])
k=int(z[0])
if k>=m*n:
    print 0
elif d>c/n:
    rou=(m*n-k)/n
    if k%n==0:
        s=rou*c
        print s
    else:
        s=(rou)*c+((m*n-k)%n)*d
        x=(rou+1)*c
        print min(s,x)

else:
    s=(m*n-k)*d
    print s

#Codeforces problem 417A: Elimination

def roof(n,p):
	r = p // n
	if p%n > 0:
		r = r + 1
	return r

c,d = (int(element) for element in input().split())

n,m = (int(element) for element in input().split())

k = int(input())

needed_number_of_problems = 0

#people still needed for the 2214 Russian Code Cup"
p = m*n - k

while p > 0:
	x = roof(n,p)
	if d*p < c*x:
		#get people from the additional rounds
		needed_number_of_problems += d
		p = p - 1
	else:
		#get people from main round
		needed_number_of_problems += c
		p = p - n

print(needed_number_of_problems)

c,d = [int(x) for x in input().strip().split()]
n,m = [int(x) for x in input().strip().split()]
k = int(input().strip())

t = n*m-k
if t<=0:
    print(0)
else:
    dp = [0]*(t+1)
    for i in range(1,t+1):
        dp[i]=min(dp[i-1]+d, c+dp[max(0,i-n)])
    print(dp[t])

def readln(): return tuple(map(int, input().split()))

c, d = readln()
n, m = readln()
k, = readln()

ans = 1 << 30
for x in range(10001):
    y = max(0, n * m - k - n * x)
    if y >= 0 and ans > c * x + d * y:
        ans = c * x + d * y
print(ans)

c, d = map(int, input().split())
n, m = map(int, input().split())
k = int(input())
need = n*m - k
if need <= 0:
    print(0)
else:
    r1 = c / n
    if r1 < d:
        div, rest = divmod(need, n)
        cont = div * c
        cont += min(c, d*rest)
        print(max(0,cont))
    else:
        print(need*d)

c,d = map(int,input().split())
n,m = map(int,input().split())
k = int(input())
x = n*m
from sys import exit
if k>=x:print(0);exit()
if c<=d:
    div,mod=(x-k)//n,(x-k)%n
    if mod>0:div+=1
    print(div*c)
else:
    if d*n<=c:print((x-k)*d)
    else:
        res=(x-k)//n*c
        mod=(x-k)%n
        if c<mod*d:res+=c
        else:res+=mod*d
        print(res)

import math
c,d = map(int,input().split())
n,m = map(int,input().split())
k=int(input())
if k>=n*m:
    print('0')
else:
    left=n*m-k
    t=c*(math.ceil(left/n))
    j= c*(left//n) + (left%n)*d
    l=d*(left)
    print(min(t,j,l))

import math
c,d = map(int,input().split())
n,m = map(int,input().split())
k = int(input())
if k>=n*m:
	print (0)
	exit()
left = n*m-k
print (min(math.ceil(left/n)*c,(left//n)*c + (left%n)*d,left*d))

import math
c,d=map(int,input().split())
n,m=map(int,input().split())
k=int(input())

if m*n <= k:
    print(0)
else:
    c1=m*c

    c2 = ((((m*n)-k)//n)*c)+((((m*n)-k)%n)*d)

    c3 = math.ceil(((m*n)-k)/n)*c

    c4 = ((m*n)-k)*d

    print(min(c1,c2,c3,c4))

#Author: squiggly_lines
#Date: 05/05/2014
#Problem: 417A

def main():
    c,d = map(int, raw_input().split())
    n,m = map(int, raw_input().split())
    k = int(raw_input())

    print solve(c,d,n,m,k)

def solve(c,d,n,m,k):
    target = n*m-k
    if target <= 0:
        return 0
    if d < (c/float(n)):
        return target*d
    else:
        alpha = target/n
        remainder = target % n
        if remainder == 0:
            return alpha*c
        if c > remainder*d:
            return alpha*c + remainder*d
        else:
            return (alpha+1)*c

if __name__ == "__main__":
    main();

c,d=map(int,raw_input().split())
n,m=map(int,raw_input().split())
k=int(raw_input())

ans=max(0,n*m-k)
count=0
dp=[[0 for i in range(2)] for i in range(10**5)]
for i in range(1,n+1):
    dp[i][0]=c
    dp[i][1]=min(i*d,c)
if ans<=n:
    print min(dp[ans][0],dp[ans][1])
else:
    for i in range(n+1,ans+1):
        dp[i][0]=c+min(dp[i-n][0],dp[i-n][1])
        dp[i][1]=d+min(dp[i-1][0],dp[i-1][1])
    print min(dp[ans][1],dp[ans][0])

from sys import stdin

rints = lambda: [int(x) for x in stdin.readline().split()]
ceil1 = lambda a, b: (a + b - 1) // b

c, d = rints()
n, m = rints()
k = int(input())
rem = max((n * m) - k, 0)
ans = min(rem * d, ceil1(rem, n) * c, (rem // n) * c + (rem % n) * d)

print(ans)

c,d = list(map(int,input().split()))
n,m = list(map(int,input().split()))
k = int(input())
t = max((m*n)-k,0)
p = min(c,n*d)
ans = p*(t//n)
rem = t%n
ans = ans+min(c,rem*d)
print(ans)

c, d = map(int, input().split())
n, m = map(int, input().split())
k = int(input())
dp = [0] * ((n + 1) * m + k)
for i in range(1, n * m - k + 1):
    dp[i] = min(dp[i - 1] + d, dp[i - n] + c)
print(dp[n * m - k])

Pm,Pa = map(int, input().split())
N,M = map(int, input().split())
k = int(input())
Rm = Pm / N
Ra = Pa

lo,hi = 0,100000

def count(mid):
	global Pm,Pa,Rm,Ra,N
	ans = 0
	while True:
		if mid < min(Pm, Pa):
			break
		if Ra <= Rm:
			if mid >= Pa:
				ans += 1
				mid -= Pa
			else:
				ans += N
				mid -= Pm
		else:
			if mid >= Pm:
				ans += N
				mid -= Pm
			else:
				ans += 1
				mid -= Pa
	return ans
while lo < hi:
	mid = (lo + hi) >> 1
	if count(mid) >= N * M - k:
		hi = mid
	else:
		lo = mid + 1
print(lo)

c,d=map(int,input().split())
n,m=map(int,input().split())
k=int(input())
t=n*m-k
if(t<=0):print(0)
elif(d<=c/n):
    print(d*t)
else:
    if(t%n==0):
        print(c*(t//n))
    else:
        a1=c*(t//n+1)
        a2=c*(t//n)+d*(t%n)
        print(min(a1,a2))

from math import ceil,floor
c,d = map(int,input().split())
n,m = map(int,input().split())
k = int(input())
Needed = n*m
if(Needed<=k):
    print(0)
    exit()
Needed -= k
x = ceil(Needed/n) * c
y = ceil(Needed) * d
z = floor(Needed/n)*c + (Needed%n)*d
print(min(x,y,z))

c,d=map(int, input().split())
n,m=map(int, input().split())
k=int(input())

z=m*n-k

if z<=0:
    print(0)
else:
    dp = [0]*100000
    for i in range(z):
        dp[i+1] = min(dp[i]+d, dp[i+1-n]+c)
    print(dp[z])

c,d=map(int,input().split())
n,m=map(int,input().split())
k=int(input())
tot=n*m
if(k>=tot):
	print("0")
else:
	rem=tot-k
	x=n/c
	y=1/d
	ans=0
	if(x>=y):
		temp=rem//n
		bacha=rem%n
		if(bacha*d<=c):
			ans=temp*c+bacha*d
		else:
			ans=(temp+1)*c
	else:
		ans=rem*d
	print(ans)

c,d = map(int,input().split())
n,m = map(int,input().split())
k = int(input())
f = [float('+inf') for i in range(n*m+n+k+2)]
f[0] = f[k] =  0
for i in range(n*m):
    f[i+1] = min(f[i+1],f[i]+d)
    f[i+n] = min(f[i+n],f[i]+c)
print(min(f[n*m:]))

# arr=list(map(int,input().split()))
# arr=sorted([(n-int(x),i) for i,x in enumerate(input().split())])
# arr=[int(q)-1 for q in input().split()]
# from collections import Counter
# n=int(input())
# n,k=map(int,input().split())
# arr=list(map(int,input().split()))
# for i in range(m):
#for _ in range(int(input())):
#n=int(input())
c,d=map(int,input().split())
n,m=map(int,input().split())
k=int(input())
var=n*m-k
dp=[0]*(n*m+1)
for i in range(1,n*m+1):
    if i<n:
        dp[i]=dp[i-1]+d
    else:
        dp[i]=min(dp[i-n]+c,dp[i-1]+d)
print(min(dp[max(0,n*m-k):n*m+1]))

c, d = [int(i) for i in input().split(" ")]
n, m = [int(i) for i in input().split(" ")]
k = int(input())

s = n*m - k
s = max(s, 0)

if c < d*n:
  stuff = s//n
  try1 = c*stuff + d*(s-n*stuff)
  try2 = c*(stuff+1)
  print(min(try1, try2))
else:
  print(d*s)

import os, sys, atexit
from io import BytesIO, StringIO

input = BytesIO(os.read(0, os.fstat(0).st_size)).readline
_OUTPUT_BUFFER = StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
    sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
c, d = map(int, input().split())
n, m = map(int, input().split())
k = int(input())
require = n * m - k
ans = 999999999
for i in range(10000):
    for j in range(10000):
        if i * n + j >= require:
            ans = min(ans, c * i + d * j)
print(ans)

import math as mt
import sys,string
input=sys.stdin.readline
import random
from collections import deque,defaultdict
L=lambda : list(map(int,input().split()))
Ls=lambda : list(input().split())
M=lambda : map(int,input().split())
I=lambda :int(input())
c,d=M()
n,m=M()
k=I()
if(n*m<=k):
    print(0)
else:
    t=n*m-k
    if(n/c<1/d):
        print(d*t)
    else:
        q=t//n
        p=t%n
        print(min(q*c+c,q*c+p*d))

c,d = [int(x) for x in raw_input().split()]
n,m = [int(x) for x in raw_input().split()]
k = int(raw_input())

total = n*m - k;

dp = [0]
dp += [0]*(total)
for i in range(1,total+1):
    dp[i] = dp[i-1]+d
    if i>=n:
        dp[i] = min(dp[i],dp[i-n]+c)

print(dp[max(total,0)])

c,d = map(int,raw_input().split())
n,m = map(int,raw_input().split())
k = int(raw_input())
need = m * n - k
main_need = c/float(n)
add_need = d
if add_need <= main_need :
	print add_need * need
else :
	s = c * ( need / n )
	last_need = need % n
	if c <= add_need * last_need :
		print s + c
	else :
		print s + add_need * last_need

c,d = map(int,raw_input().split())
n,m = map(int,raw_input().split())
k = int(raw_input())
need = m * n - k
main_need = c/float(n)
add_need = d
if add_need <= main_need :
	print add_need * need
else :
	s = c * ( need / n )
	last_need = need - s
	if c <= add_need * last_need :
		print s + c
	else :
		print s + add_need * last_need

import sys,math

if __name__ == '__main__':
	[c,d] = map(int,sys.stdin.readline().split())
	[n,m] = map(int,sys.stdin.readline().split())
	k = int(raw_input())
	minimum = n*m - k
	if minimum == 0:
		print 0
	else:
		one = minimum / n if minimum % n == 0 else minimum / n + 1
		two = minimum / d if minimum % d == 0 else minimum / d + 1
		print min(one,two)

import sys,math

if __name__ == '__main__':
	[c,d] = map(int,sys.stdin.readline().split())
	[n,m] = map(int,sys.stdin.readline().split())
	k = int(raw_input())
	minimum = n*m - k
	if minimum == 0:
		print 0
	else:
		one = minimum / n * c
		print min(one+c,one+d)

import sys,math

if __name__ == '__main__':
	[c,d] = map(int,sys.stdin.readline().split())
	[n,m] = map(int,sys.stdin.readline().split())
	k = int(raw_input())
	minimum = n*m - k
	if minimum == 0:
		print 0
	else:
		one = minimum / n * c

		print min(one+c,minimum % n * d)

import sys,math

if __name__ == '__main__':
	input = map(int,sys.stdin.readline().split())
	for i in input:
		print(i)

import sys,math

if __name__ == '__main__':
	[c,d] = map(int,sys.stdin.readline().split())
	[n,m] = map(int,sys.stdin.readline().split())
	k = int(raw_input())
	minimum = n*m - k
	if minimum == 0:
		print 0
	else:
		one = minimum / n * c + (c if minimum % n != 0 else 0)
		two = minimum / n * c + minimum % n * d
		three = minimum * d
		print min(one,two,three)

c, d = map(int, raw_input().split())
n, m = map(int, raw_input().split())
k = int(raw_input())

res = m * c
p = n * m - k

for i in range(m+1):
	for j in range(n + 1):
		if i * n + j >= p: res = min(res, c * i + d * j)

print res

c, d = map(int, raw_input().split())
n, m = map(int, raw_input().split())
k = int(raw_input())

res = m * c
p = n * m - k

for i in range(m+1):
	for j in range(n * m/d + 1):
		if i * n + j >= p: res = min(res, c * i + d * j)

print res

c, d = map(int, raw_input().split())
n, m = map(int, raw_input().split())
k = int(raw_input())

res = m * c
p = n * m - k

for i in range(p/n + 2):
	for j in range(p + 1):
		if i * n + j >= p: res = min(res, c * i + d * j)

print res

c, d = map(int, raw_input().split())
n, m = map(int, raw_input().split())
k = int(raw_input())

res = m * c
p = n * m - k

for i in range(p/n+1):
	for j in range(p + 1):
		if i * n + j >= p: res = min(res, c * i + d * j)

print res

c,d = [int(x) for x in raw_input().split()]
n,m = [int(x) for x in raw_input().split()]
k = int(raw_input())
probs = 0
go = d
add = 1
if n/float(c) > float(m):
    go = c
    add = n

while 1:

    if k >= m*n:
        break
    if k + 1 == m*n:
        probs += min(c,d)
        break
    elif k + n >= m*n:
        probs += min(c, (m*n - k)*d)
        break
    else:
        k+=add
        probs+=go
print probs

c,d=[int(x) for x in raw_input().split()]
n,m=[int(x) for x in raw_input().split()]
k=int(raw_input())
print (n*m-k+n-1)/n*c

c,d=[int(x) for x in raw_input().split()]
n,m=[int(x) for x in raw_input().split()]
k=int(raw_input())
print min((n*m-k+n-1)/n*c,(n*m-k)/n*c+(n*m-k)%n*d,(n*m-k)*d)

c,d=[int(x) for x in raw_input().split()]
n,m=[int(x) for x in raw_input().split()]
k=int(raw_input())
print min((n*m-k+n-1)/n*c,(n*m-k)*d)

c,d=[int(x) for x in raw_input().split()]
n,m=[int(x) for x in raw_input().split()]
k=int(raw_input())
print (n*m-k+n-1)/n

c,d = map(int,raw_input().strip().split())
n,m = map(int,raw_input().strip().split())
k = int(raw_input())

##c = 2
##d = 2
##n = 2
##m = 1
##k = 2

task_count = 0
rounds_c = 0
rounds_d = 0
minamount = n*m-k
if (minamount <= 0):
    task_count = 0
else:
    cost_c = float(n*1.0/1)
    cost_d = float(1*1.0/d)
    if cost_c>cost_d:
        ost = minamount % n
        if ost == 0:
            task_count = (minamount / n)*c
        else:
            rounds_c = minamount / n
            task_count = rounds_c * c
            if ost*d > c:
                task_count += c
            else:
                task_count += ost*d

print task_count

c,d = map(int,raw_input().strip().split())
n,m = map(int,raw_input().strip().split())
k = int(raw_input())

##c = 2
##d = 2
##n = 2
##m = 1
##k = 2

task_count = 0
rounds_c = 0
rounds_d = 0
minamount = n*m-k
if (minamount <= 0):
    task_count = 0
else:
    cost_c = float(n*1.0/1)
    cost_d = float(1*1.0/d)
    if cost_c>cost_d:
        ost = minamount % n
        if ost == 0:
            task_count = (minamount / n)*c
        else:
            rounds_c = minamount / n
            task_count = rounds_c * c
            if ost*d > c:
                task_count += c
            else:
                task_count += ost*d
    else:
        task_count = (minamount / 1)*d

print task_count

if __name__ == '__main__':
    line = raw_input()
    num = line.strip().split(" ")
    c, d = int(num[0]), int(num[1])
    line = raw_input()
    num = line.strip().split(" ")
    n, m = int(num[0]), int(num[1])
    k = int(raw_input())
    total = n * m
    need = total - k
    prob = 0
    while need > 0:
      if c / n < d:
        need -= n
        prob += c
      else:
        need -= 1
        prob += d
    print prob

c,d = [int(item) for item in raw_input().split(' ')]
n,m = [int(item) for item in raw_input().split(' ')]
k = int(raw_input())
print c,d,n,m,k
for i in range(0, m + 1):
    x = i
    if x * n + 1 >= m * n:
        y = 0
    else:
        y = m * n - k - n * x
    ans = c * x + d * y
    if i == 0:
        mx = ans
        continue
    mx = ans if mx > ans else mx

print mx

c,d = [int(item) for item in raw_input().split(' ')]
n,m = [int(item) for item in raw_input().split(' ')]
k = int(raw_input())
for i in range(0, m + 1):
    x = i
    if x * n + k >= m * n:
        y = 0
    else:
        y = m * n - k - n * x
    ans = c * x + d * y
    if i == 0:
        mx = ans
        continue
    mx = ans if mx > ans else mx
    print mx,ans,x,y

print mx

c, d = map ( int, raw_input ( ).split ( ) )
n, m = map ( int, raw_input ( ).split ( ) )
k = int(raw_input ( ) )

rem = n*m - k
minAns = 1e10

for i in range(1000):
    for j in range(1000):
        if ( i * n + j >= rem and minAns > i * c + j * d):
            minAns = i * c + j * d

print minAns

input = raw_input
c, d = map(int, input().split())
n, m = map(int, input().split())
k = int(input())

s = n*m - k
res = 0

if s > 0:
    if (c/n) > d:
        res += d*s
    else:
        os = s - (s // n)
        res += (s // n) * c
        if c < d*os:
            res += c
        else:
            res += d*os

print( res )

input = raw_input
c, d = map(int, input().split())
n, m = map(int, input().split())
k = int(input())

s = n*m - k

os = s - (s // n)
res = (s // n) * c
if c < d*os:
    res += c
else:
    res += d*os

if res < 0:
    res = 0

print( res )

input = raw_input
c, d = map(int, input().split())
n, m = map(int, input().split())
k = int(input())

s = n*m - k
res = 0

if s > 0:
    res = c
    s -= n
    if (c/n) > d:
        res += d*s
    else:
        os = s - (s // n)
        res += (s // n) * c
        if c < d*os:
            res += c
        else:
            res += d*os

print( res )

input = raw_input
c, d = map(int, input().split())
n, m = map(int, input().split())
k = int(input())

s = n*m - k

if (c/n) > d:
    res = d*s
else:
    os = s - (s // n)
    res = (s // n) * c
    if c < d*os:
        res += c
    else:
        res += d*os

if res < 0:
    res = 0

print( res )

input = raw_input
c, d = map(int, input().split())
n, m = map(int, input().split())
k = int(input())

s = n*m - k

os = s - (s // n)
res = (s // n) * c
if c < d*os:
    res += c
else:
    res += d*os

print( res )

import math
def ar():
    return map(int,raw_input().split())
c,d=ar()
n,m=ar()
k=ar()[0]
req=n*m-k
mi=100000000
for i in range((req/n)+n):
    for j in range(req+3):
        if c*n*i+d*j >=req:
            if i+j<mi:
                mi=i+j
print mi

import math
def ar():
    return map(int,raw_input().split())
c,d=ar()
n,m=ar()
k=ar()[0]
req=(n*m)-k
mi=100000000
for i in range(req/n + n):
    for j in range(req+3):
        if n*i+j >=req:
            if c*i+j*d<mi:
                mi=i*c+j*d
print mi

import math
def ar():
    return map(int,raw_input().split())
c,d=ar()
n,m=ar()
k=ar()[0]
req=(n*m)-k
mi=100000000
for i in range((req/n)+n):
    for j in range(req+3):
        if n*i+j >=req:
            if c*i+j*d<mi:
                mi=i*c+j*d
##if mi!=0:
##    req-=n
##    for i in range(1,(req/n)+n):
##        for j in range(req+3):
##            if c*n*i+d*j >=req:
##                if i*c+j*d<mi:
##                    mi=i*c+j*d
##    mi+=1
print mi

import math
def ar():
    return map(int,raw_input().split())
c,d=ar()
n,m=ar()
k=ar()[0]
req=n*m-k
mi=100000000
for i in range(req/(c*n)+2):
    for j in range(req/d+2):
        if c*n*i+d*j >=req:
            if i+j<mi:
                mi=i+j
print mi

import math
def ar():
    return map(int,raw_input().split())
c,d=ar()
n,m=ar()
k=ar()[0]
req=n*m-k
mi=100000000
for i in range((req/n)+n):
    for j in range(req+3):
        if c*n*i+d*j >=req:
            if i+j<mi:
                mi=i+j
if mi!=0:
    req-=n
    for i in range(1,(req/n)+n):
        for j in range(req+3):
            if c*n*i+d*j >=req:
                if i+j<mi:
                    mi=i+j
    mi+=1
print mi

import math
def ar():
    return map(int,raw_input().split())
c,d=ar()
n,m=ar()
k=ar()[0]
req=(n*m)-k
mi=100000000
for i in range((req/n)+n):
    for j in range(req+3):
        if c*n*i+d*j >=req:
            if i+j<mi:
                mi=i*c+j*d
if mi!=0:
    req-=n
    for i in range(1,(req/n)+n):
        for j in range(req+3):
            if c*n*i+d*j >=req:
                if i*c+j*d<mi:
                    mi=i*c+j*d
    mi+=1
print mi

import math
def ar():
    return map(int,raw_input().split())
c,d=ar()
n,m=ar()
k=ar()[0]
req=n*m
mi=100000000
for i in range(req/n+3):
    for j in range(req+3):
        if c*n*i+d*j >=req:
            if i+j<mi:
                mi=i+j
print mi

from math import ceil

c, d = map(int, raw_input().split())
n, m = map(int, raw_input().split())
k = input()

def f(c, d, n, m, k):
    p = n*m - k
    if p <= 0: return 0
    print p, d, n
    a = (
        p * d,
        int(ceil(float(p)/n)) * c,
        (p/n) * c + (p%n) * d
    )
    #print a
    return min(a)
print f(c, d, n, m, k)

vals = [int(x) for x in raw_input().split()]
a=vals[0]
b=vals[1]
vals = [int(x) for x in raw_input().split()]
n=vals[0]
m=vals[1]
k=input()

t=n*m-k
r=0

while t>0:
    if a<t*b:
        t-=n
        r+=a
    else:
        t-=1
        r+=b

print(r)

vals = [int(x) for x in raw_input().split()]
a=vals[0]
b=vals[1]
vals = [int(x) for x in raw_input().split()]
n=vals[0]
m=vals[1]
k=input()

t=n*m-k
r=0

while t>0:
    if a<n*b:
        t-=n
        r+=a
    else:
        t-=1
        r+=b

print(r)

'''
Created on Apr 17, 2014

@author: Arjun
'''
stuff = raw_input()
stuff2 = raw_input()
autoAdvance = int(raw_input())
lista = stuff.split()
listb = stuff2.split()
mainRound = int(lista[0])
extraRound = int(lista[1])
mainAdvance = int(listb[0])
m = int(listb[1])
needAdvance = mainAdvance*m-autoAdvance
val = 0
if(needAdvance%m == 0):
    divisor = needAdvance/mainAdvance
else:
    divisor = needAdvance/mainAdvance + 1

if(needAdvance<=0):
    print 0
elif(mainRound < extraRound):
    print mainRound*divisor
else:
    all2 = extraRound*needAdvance
    all1 = mainRound*divisor
    blah = (needAdvance/mainAdvance)*mainRound + (needAdvance - (needAdvance/mainAdvance) *mainAdvance)*extraRound
    print min(all1,all2,blah)

#!/usr/bin/env python

import sys
import logging

c, d = map(int, raw_input().split())
n, m = map(int, raw_input().split())
k = input()

t = n * m - k

candidates = []

candidates += [c * (t / n + (1 if t%n != 0 else 0))]
candidates += [d * t]

candidates += [c * (t/n) + (t - t/n) * d]

print min(candidates)

#!/usr/bin/env python

import sys
import logging

c, d = map(int, raw_input().split())
n, m = map(int, raw_input().split())
k = input()

t = n * m - k

candidates = []

candidates += [c * (t / n + (1 if t%n != 0 else 0))]
candidates += [d * t]

candidates += [c * (t/n) + (t - n*(t/n)) * d]

print min(candidates)

c, d = map(int, raw_input().split())
n, m = map(int, raw_input().split())
k = int(raw_input())

x = n * m - k
case = 0

while x > 0:
    if d < (c / n) or d < (c / x):
        x += d
        case -= 1
    else:
        x -= n
        case += c

print case

c, d = map(int, raw_input().split())
n, m = map(int, raw_input().split())
k = int(raw_input())

x = n * m - k
case = 0

while x > 0:
    if d < (c / n):
        x += d
        case -= 1
    elif d < (c / x):
        x += d
        case -= 1
    else:
        x -= n
        case += c

print case

import math
x=raw_input().split(' ')
c=int(x[0])
d=int(x[1])
y=raw_input().split(' ')
n=int(y[0])
m=int(y[1])
pro=n*m
k=input()
pro=pro-k
if c<=d:
    ans=int(math.ceil(float(pro)/n))
else:
    if float(n)/c>=float(1)/d:
        if pro%n==0:
            ans=pro/n
        else:
            ans=int(math.floor(float(pro)/n))*c
            am=pro%n
            if c<=am*d:
                ans=ans+c
            else:
                ans=ans+am*d
    else:
        ans=pro*d
print ans

c, d = map(int, raw_input().split())
n, m = map(int, raw_input().split())
k = int(raw_input())

totalPeople = n * m

mainProblems = (totalPeople - k) / n
mainProblems *= c

print mainProblems

def debug():
    c,d=map(int,raw_input().split())
    n,m=map(int,raw_input().split())
    k=input()
    final=n*m
    need=final-k
    if need==0:
        print 0
    else:
        fp1=c/float(n)
        fp2=d
        if fp1<fp2:
            timu=(need/n)* c
            rest= need- (need/n)*n
            if rest:
                if rest*d > c:
                    print timu+c
                else:
                    print timu+rest*d
            else:
                print timu
        else:
            print need*d

debug()

x=raw_input().split()
y=raw_input().split()
z=raw_input().split()
c=int(x[0])
d=int(x[1])
n=int(y[0])
m=int(y[1])
k=int(z[0])
if k>=m*n:
    print 0
elif d>c/n:
    rou=(m*n-k)/n
    if k%n==0:
        s=rou*c
        print s
    else:
        s=(rou)*c+((m*n-k)%n)*d
        print s

else:
    s=(m*n-k)*d
    print s

x=raw_input().split()
y=raw_input().split()
z=raw_input().split()
c=int(x[0])
d=int(x[1])
n=int(y[0])
m=int(y[1])
k=int(z[0])
if k>=m*n:
    print 0
elif d*n>c:
    rou=(m*n-k)/n+1
    s=rou*c
    print s
else:
    s=(m*n-k)*d
    print s

x=raw_input().split()
y=raw_input().split()
z=raw_input().split()
c=int(x[0])
d=int(x[1])
n=int(y[0])
m=int(y[1])
k=int(z[0])
if k>=m*n:
    print 0
elif d>c/n:
    rou=(m*n-k)/n
    if k%n==0:
        s=rou*c
        print s
    else:
        s=(rou+1)*c
        print s

else:
    s=(m*n-k)*d
    print s

#Author: squiggly_lines
#Date: 05/05/2014
#Problem: 417A

def main():
    c,d = map(int, raw_input().split())
    n,m = map(int, raw_input().split())
    k = int(raw_input())

    print solve(c,d,n,m,k)

def solve(c,d,n,m,k):
    target = n*m-k
    if target <= 0:
        return 0
    if d < (c/float(n)):
        if int(target/d) == target/d:
            return target/d
        else:
            return target/d + 1
    else:
        alpha = target/n
        remainder = target % n
        if remainder == 0:
            return alpha*c
        if c > remainder*d:
            return alpha*c + remainder*d
        else:
            return (alpha+1)*c

if __name__ == "__main__":
    main();

#Author: squiggly_lines
#Date: 05/05/2014
#Problem: 417A

def main():
    c,d = map(int, raw_input().split())
    n,m = map(int, raw_input().split())
    k = int(raw_input())

    print solve(c,d,n,m,k)

def solve(c,d,n,m,k):
    target = n*m-k
    if d < (c/float(n)):
        if int(target/d) == target/d:
            return target/d
        else:
            return target/d + 1
    else:
        alpha = target/n
        remainder = target % n
        if remainder == 0:
            return alpha*c
        if c > remainder*d:
            return alpha*c + remainder*d
        else:
            return (alpha+1)*c

if __name__ == "__main__":
    main();

#Author: squiggly_lines
#Date: 05/05/2014
#Problem: 417A

def main():
    c,d = map(int, raw_input().split())
    n,m = map(int, raw_input().split())
    k = int(raw_input())

    print solve(c,d,n,m,k)

def solve(c,d,n,m,k):
    target = n*m-k
    if d < (c/float(n)):
        if int(target/d) == target/d:
            return target/d
        else:
            return target/d + 1
    else:
        alpha = target/n
        remainder = target % n
        if remainder == 0:
            return alpha
        if c > remainder*d:
            return alpha*c + remainder*d
        else:
            return (alpha+1)*c

if __name__ == "__main__":
    main();

#Author: squiggly_lines
#Date: 05/05/2014
#Problem: 417A

def main():
    c,d = map(int, raw_input().split())
    n,m = map(int, raw_input().split())
    k = int(raw_input())

    print solve(c,d,n,m,k)

def solve(c,d,n,m,k):
    target = n*m-k
    if d < (c/float(n)):
        if int(target/d) == target/d:
            return target/d
        else:
            return target/d + 1
    else:
        alpha = target/n
        remainder = target % n
        if remainder == 0:
            return alpha
        if c > remainder*d:
            return alpha + remainder*d
        else:
            return alpha+1

if __name__ == "__main__":
    main();

from sys import stdin

rints = lambda: [int(x) for x in stdin.readline().split()]
ceil1 = lambda a, b: (a + b - 1) // b

c, d = rints()
n, m = rints()
k = int(input())
rem = (n * m) - k
ans = min(rem * d, ceil1(rem, n) * c)
print(ans)

Pm,Pa = map(int, input().split())
N,M = map(int, input().split())
k = int(input())
Rm = Pm / N
Ra = Pa

lo,hi = 0,100000

def count(mid):
	global Pm,Pa,Rm,Ra,N
	ans = 0
	while True:
		if mid < min(Pm, Pa):
			break
		if Ra <= Ra:
			if mid >= Pa:
				ans += 1
				mid -= Pa
			else:
				ans += N
				mid -= Pm
		else:
			if mid >= Pm:
				ans += N
				mid -= Pm
			else:
				ans += 1
				mid -= Pa
	return ans
while lo < hi:
	mid = (lo + hi) >> 1
	if count(mid) >= N * M - k:
		hi = mid
	else:
		lo = mid + 1
print(lo)

c,d=map(int,input().split())
n,m=map(int,input().split())
k=int(input())
t=n*m-k
if(d<=c/n):
    print(d*t)
else:
    if(t%n==0):
        print(c*(t//n))
    else:
        print(min(c*(t//n+1),c*(t//n)+d*t%n))

# arr=list(map(int,input().split()))
# arr=sorted([(n-int(x),i) for i,x in enumerate(input().split())])
# arr=[int(q)-1 for q in input().split()]
# from collections import Counter
# n=int(input())
# n,k=map(int,input().split())
# arr=list(map(int,input().split()))
# for i in range(m):
#for _ in range(int(input())):
#n=int(input())
c,d=map(int,input().split())
n,m=map(int,input().split())
k=int(input())
var=n*m-k
dp=[0]*(n*m+1)
for i in range(1,n*m+1):
    if i<n:
        dp[i]=dp[i-1]+d
    else:
        dp[i]=min(dp[i-n]+c,dp[i-1]+d)
print(min(dp[n*m-k:n*m+1]))

c, d = [int(i) for i in input().split(" ")]
n, m = [int(i) for i in input().split(" ")]
k = int(input())

s = n*m - k
s = max(s, 0)

if c < d*n:
  stuff = s//n
  try1 = c*stuff + d*(s-n*stuff)
  try2 = (c+1)*stuff
  print(min(try1, try2))
else:
  print(d*s)

c, d = [int(i) for i in input().split(" ")]
n, m = [int(i) for i in input().split(" ")]
k = int(input())

s = n*m - k

if c < d*n:
  stuff = s//n
  try1 = c*stuff + d*(s-n*stuff)
  try2 = (c+1)*stuff
  print(min(try1, try2))
else:
  print(d*s)

import math as mt
import sys,string
input=sys.stdin.readline
import random
from collections import deque,defaultdict
L=lambda : list(map(int,input().split()))
Ls=lambda : list(input().split())
M=lambda : map(int,input().split())
I=lambda :int(input())
c,d=M()
n,m=M()
k=I()
if(n*m<=k):
    print(0)
else:
    t=n*m-k
    if(n/c<1/d):
        print(d*t)
    else:
        q=t//n
        p=t%n
        print(min(q*c+c,q+p*d))

import math as mt
import sys,string
input=sys.stdin.readline
import random
from collections import deque,defaultdict
L=lambda : list(map(int,input().split()))
Ls=lambda : list(input().split())
M=lambda : map(int,input().split())
I=lambda :int(input())
c,d=M()
n,m=M()
k=I()
if(n*m<=k):
    print(0)
else:
    t=n*m-k
    if(n/c<1/d):
        print(d*t)
    else:
        q=t//n
        p=t%n
        print(min(q*c+1,q+p*d))

import sys

c, d = map(int, sys.stdin.readline().split())
n, m = map(int, sys.stdin.readline().split())
k = int(sys.stdin.readline())

total = n * m - k
if total <= 0:
  print(0)
  sys.exit(0)

a = [d*i for i in range(0, total+1)]
print(a)

for i in range(1, total+1):
  if i <= n:
    if a[i] > c:
      a[i] = c
  else:
    if a[i-n] + c < a[i]:
      a[i] = a[i-n] + c

print( a[total] )

import math
c,d=map(int,input('').split())
n,m=map(int,input('').split())
k=int(input(''))
if 1/d>n/c:    print((n*m-k)*d)
else:    print((math.ceil((n*m-k)/n))*c)

import math
c,d=map(int,input('').split())
n,m=map(int,input('').split())
k=int(input(''))
if k<0:
    print('0')
    exit()
if 1/d>n/c:    print((n*m-k)*d)
else:
    if (math.ceil((n*m-k)/n)*c)<((n*m-k)//n)*c+((n*m-k)%n)*d: print (math.ceil((n*m-k)/n)*c)
    else: print(((n*m-k)//n)*c+((n*m-k)%n)*d)

import math
c,d=map(int,input('').split())
n,m=map(int,input('').split())
k=int(input(''))
if k<0: k=0
if 1/d>n/c:    print((n*m-k)*d)
else:
    if (math.ceil((n*m-k)/n)*c)<((n*m-k)//n)*c+((n*m-k)%n)*d: print (math.ceil((n*m-k)/n)*c)
    else: print(((n*m-k)//n)*c+((n*m-k)%n)*d)

import math
c,d=map(int,input('').split())
n,m=map(int,input('').split())
k=int(input(''))
if 1/d>n/c:    print((n*m-k)*d)
else:
    if (math.ceil((n*m-k)/n)*c)<((n*m-k)//n)*c+((n*m-k)%n)*d: print (math.ceil((n*m-k)/n)*c)
    else: print(((n*m-k)//n)*c+((n*m-k)%n)*d)

problems = input().split()
c = int(problems[0])
d = int(problems[1])
n_m = input().split()
n = int(n_m[0])
m = int(n_m[1])
k = int(input())

from queue import PriorityQueue
import math

class MyPriorityQueue(PriorityQueue):
    def __init__(self):
        PriorityQueue.__init__(self)
        self.counter = 0

    def put(self, item, priority):
        PriorityQueue.put(self, (priority, self.counter, item))
        self.counter += 1

    def get(self, *args, **kwargs):
        _, _, item = PriorityQueue.get(self, *args, **kwargs)
        return item

def cost(x1, x2):
    return c * x1 + d * x2

def check(x1, x2):
    return x1 * n + x2 + k >= n * m

def get_x1(x1, x2):
    return math.ceil((n*m - k - x2) / n)

def get_x2(x1, x2):
    return math.ceil(n * (m-x1) - k)

q = MyPriorityQueue()
q.put((0, 0), 0)
s = set()
while not q.empty():
    (x1, x2) = q.get()
    if check(x1, x2):
        print(c * x1 + d * x2)
        break
    cost1 = cost(x1, x2 + 1)
    cost2 = cost(x1 + 1, x2)
    # if cost1 > cost2:
    #     q.put((x1 + 1, x2), cost2)
    # else:
    #     q.put((x1, x2 + 1), cost1)
    if (x1+1, x2) not in s:
        q.put((x1 + 1, x2), cost2)
        s.add((x1+1, x2))
    elif (x1, x2+1) not in s:
        q.put((x1, x2 + 1), cost1)
        s.add((x1, x2+1))

problems = input().split()
c = int(problems[0])
d = int(problems[1])
n_m = input().split()
n = int(n_m[0])
m = int(n_m[1])
k = int(input())

from queue import PriorityQueue

class MyPriorityQueue(PriorityQueue):
    def __init__(self):
        PriorityQueue.__init__(self)
        self.counter = 0

    def put(self, item, priority):
        PriorityQueue.put(self, (priority, self.counter, item))
        self.counter += 1

    def get(self, *args, **kwargs):
        _, _, item = PriorityQueue.get(self, *args, **kwargs)
        return item

def cost(x1, x2):
    return c * x1 + d * x2

def check(x1, x2):
    return x1 * n + x2 + k >= n * m

q = MyPriorityQueue()
q.put((0, 0), 0)
while not q.empty():
    (x1, x2) = q.get()
    if check(x1, x2):
        print(c * x1 + d * x2)
        break
    cost1 = cost(x1, x2 + 1)
    cost2 = cost(x1 + 1, x2)
    if cost1 > cost2:
        q.put((x1 + 1, x2), cost2)
    else:
        q.put((x1, x2 + 1), cost1)

#import sys
#sys.stdin = open('input.txt','r')
c, d = map(int, input().split())
n, m = map(int, input().split())
k = int(input())
L = 10001
for f in range(m // c + 1):
	for g in range((n * m) // d + 1):
		if f * n * c + g * d + k >= n * m:
			L = min(L, f * c + g * d)
print(L)

#import sys
#sys.stdin = open('input.txt','r')
c, d = map(int, input().split())
n, m = map(int, input().split())
k = int(input())
L = 10001
for f in range(m // c + 1):
	for g in range(n * m // d + 1):
		if f * n * c + g * d + k >= n * m:
			L = min(L, f + g)
print(L)

#import sys
#sys.stdin = open('input.txt','r')
c, d = map(int, input().split())
n, m = map(int, input().split())
k = int(input())
L = 10001
for f in range(n * m + 1):
	for g in range(n * m + 1):
		if f * n * c + g * d + k >= n * m:
			L = min(L, f * c + g * d)
print(L)

#import sys
#sys.stdin = open('input.txt','r')
c, d = map(int, input().split())
n, m = map(int, input().split())
k = int(input())
L = 10001
for f in range(m + 1):
	for g in range(n * m + 1):
		if f * n * c + g * d + k >= n * m:
			L = min(L, f * c + g * d)
print(L)

#c,d,n,m,k=map(int,input().split())
c, d = map(int, input().split())
n, m = map(int, input().split())
k = int(input())

# c и d (1 ≤ c, d ≤ 100)  количество задач в основном и дополнительном раундах
# n и m (1 ≤ n, m ≤ 100) n победителей
# k (1 ≤ k ≤ 100) — число заранее отобранных победителей

S = 0
if n*m>k :
    nub = n*m-k
    S = 100000000000
    S0 = S
    i=0
    while S0<=S and i<int(nub/c):
        S = S0
        S0 = i*c + d*max(0, nub-n*i)
        # print(i,S,S0)
        i += 1

print(S)

#c,d,n,m,k=map(int,input().split())
c, d = map(int, input().split())
n, m = map(int, input().split())
k = int(input())

# c и d (1 ≤ c, d ≤ 100)  количество задач в основном и дополнительном раундах
# n и m (1 ≤ n, m ≤ 100) n победителей
# k (1 ≤ k ≤ 100) — число заранее отобранных победителей

S = 0
if n*m>k :
    nub = n*m-k
    S = 100000000000
    S0 = S
    i=0
    while S0<=S and i<=int(nub/c+2):
        S = S0
        S0 = i*c + d*max(0, nub-n*i)
        #print(i,S,S0)
        i += 1

print(S)

#c,d,n,m,k=map(int,input().split())
c, d = map(int, input().split())
n, m = map(int, input().split())
k = int(input())

# c и d (1 ≤ c, d ≤ 100)  количество задач в основном и дополнительном раундах
# n и m (1 ≤ n, m ≤ 100) n победителей
# k (1 ≤ k ≤ 100) — число заранее отобранных победителей

S = 0
if n*m>k :
    nub = n*m-k
    S = 100000000000
    S0 = S
    i=0
    while S0<=S and i<int(nub/c+1):
        S = S0
        S0 = i*c + d*max(0, nub-n*i)
        # print(i,S,S0)
        i += 1

print(S)

c, d = map(int, input().split())
n, m = map(int, input().split())
k = int(input())
total = n * m - k
if k >= n * m:
  print(0)
elif c < d:
  print(((total // n) + 1) * c)
else:
  nr = 0
  nn = (c / n)
  nm = d
  if nn < nm:
    while (nr * n) + n < total:
      nr += 1
    npn = (nr + 1) * c
    npm = nr * c + d * (total - nr * n)
    print(min(npn, npm))
  else:
    print(m * total)

c, d = map(int, input().split())
n, m = map(int, input().split())
k = int(input())
total = n * m - k
if k >= total:
  print(0)
elif n > m and c < d:
  print(((total // n) + 1) * c)
else:
  nr = 0
  nn = (c / n)
  nm = m
  if nn < nm:
    while (nr * n) + n < total:
      nr += 1
    npn = (nr + 1) * c
    npm = nr * c + d * (total - nr * n)
    print(min(npn, npm))
  else:
    print(m * total)

c, d = map(int, input().split())
n, m = map(int, input().split())
k = int(input())
total = n * m - k
if k >= n * m:
  print(0)
elif c < d:
  if total % n == 0:
    print(((total // n)) * c)
  else:
    print(((total // n) + 1) * c)
else:
  nr = 0
  nn = (c / n)
  nm = d
  if nn < nm:
    #while (nr * n) + n < total:
    #  nr += 1
    nr = total // n
    npn = nr * c
    if nr * n < total:
      npn = (nr + 1) * c
    npm = nr * c + d * (total - nr * n)
    print(min(npn, npm))
  else:
    print(m * total)

c, d = map(int, input().split())
n, m = map(int, input().split())
p = 0
k = int(input())
if m*n <= k:
    print(0)
else:
    a = [0]*(m*n+1)
    #a[k+1] = min(c,d)
    for i in range(k+1,m*n+1):
        if p == 0:
            if d > c:
                a[i] = a[i-1]+c
                p = n-1
            else:
                a[i] = a[i-1]+d
        else:
            p-=1
            a[i] = a[i-1]
    print(a[m*n])

c, d = list(map(int, input().split()))
n, m = list(map(int, input().split()))
k = int(input())
kolvo = m * n - k

print(min(c * (kolvo // n), d * n * (kolvo // n)) + min(c, d * (kolvo % n)))

def f(x, y): return x * c + y * d
c, d = map(int, input().split())
n, m = map(int, input().split())
k = s = n * m - int(input())
x = 0
while k > x * n:
    t = f(x, k - x * n)
    if t < s: s = t
    x += 1
print(min(s, f(x, 0)))

#Codeforces problem 417A: Elimination

def roof(c,p):
	r = p // c
	if p%c > 0:
		r = r + 1
	return r

c,d = (int(element) for element in input().split())

n,m = (int(element) for element in input().split())

k = int(input())

needed_number_of_problems = 0

#people still needed for the 2214 Russian Code Cup"
p = m*n - k

while p > 0:
	x = roof(c,p)
	if d*p < c*x:
		#get people from the additional rounds
		needed_number_of_problems += d*p
		p = 0
	else:
		#get people from main round
		needed_number_of_problems += c
		p = p - n

print(needed_number_of_problems)

#Codeforces problem 417A: Elimination

def roof(c,p):
	r = p // c
	if p%c > 0:
		r = r + 1
	return r

c,d = (int(element) for element in input().split())

n,m = (int(element) for element in input().split())

k = int(input())

needed_number_of_problems = 0

#people still needed for the 2214 Russian Code Cup"
p = m*n - k

while p > 0:
	x = roof(c,p)
	if d*p < c*x:
		#get people from the additional rounds
		needed_number_of_problems += d
		p = p - 1
	else:
		#get people from main round
		needed_number_of_problems += c
		p = p - n

print(needed_number_of_problems)

#Codeforces problem 417A: Elimination

c,d = (int(element) for element in input().split())

n,m = (int(element) for element in input().split())

k = int(input())

needed_number_of_problems = 0

#people still needed for the 2214 Russian Code Cup"
p = m*n - k

while p > 0:
	x = c // p
	if d*p < c*x:
		#get people from the additional rounds
		needed_number_of_problems += d*p
		p = 0
	else:
		#get people from main round
		needed_number_of_problems += c
		p = p - n

print(needed_number_of_problems)

c,d = [int(x) for x in input().strip().split()]
n,m = [int(x) for x in input().strip().split()]
k = int(input().strip())

t = n*m-k
if t<=0:
    print(0)
else:
    dp = [0]*(t+1)
    for i in range(1,t+1):
        if i<n:
            dp[i]=min(dp[i-1]+d, n)
        else:
            dp[i]=min((c+dp[i-n]), (d+dp[i-1]))
    print(dp[t])

c,d = [int(x) for x in input().strip().split()]
n,m = [int(x) for x in input().strip().split()]
k = int(input().strip())

t = n*m-k
if t<=0:
    print(0)
else:
    dp = [0]*(t+1)
    for i in range(1,t+1):
        if i<n:
            dp[i]=min(d,c)
        else:
            dp[i]=min((c+dp[i-n]), (d+dp[i-1]))
    print(dp[t])

c, d = map(int, input().split())
n, m = map(int, input().split())
k = int(input())
need = n*m - k
r1 = c / n
if r1 < d:
    div, rest = divmod(need, n)
    cont = div
else:
    cont = need * d
cont += min(c, d*rest)
print(cont)

c, d = map(int, input().split())
n, m = map(int, input().split())
k = int(input())
need = n*m - k
r1 = c / n
if r1 < d:
    div, rest = divmod(need, n)
    cont = div * c
else:
    cont = need * d
cont += min(c, d*rest)
print(cont)

c, d = map(int, input().split())
n, m = map(int, input().split())
k = int(input())
need = n*m - k
if k >= need:
    print(0)
else:
    r1 = c / n
    if r1 < d:
        div, rest = divmod(need, n)
        cont = div * c
    else:
        cont = need * d
    cont += min(c, d*rest)
    print(max(0,cont))

c,d=map(int,input().split())
n,m=map(int,input().split())
k=int(input())

if m*n <= k:
    print(0)
else:
    c1=m*c

    c2 = ((((m*n)-k)//n)*c)+((((m*n)-k)%n)*d)

    print(min(c1,c2))