Anya loves to watch horror movies. In the best traditions of horror, she will be visited by m ghosts tonight. Anya has lots of candles prepared for the visits, each candle can produce light for exactly t seconds. It takes the girl one second to light one candle. More formally, Anya can spend one second to light one candle, then this candle burns for exactly t seconds and then goes out and can no longer be used.

For each of the m ghosts Anya knows the time at which it comes: the i-th visit will happen w_{i} seconds after midnight, all w_{i}'s are distinct. Each visit lasts exactly one second.

What is the minimum number of candles Anya should use so that during each visit, at least r candles are burning? Anya can start to light a candle at any time that is integer number of seconds from midnight, possibly, at the time before midnight. That means, she can start to light a candle integer number of seconds before midnight or integer number of seconds after a midnight, or in other words in any integer moment of time.


-----Input-----

The first line contains three integers m, t, r (1 ≤ m, t, r ≤ 300), representing the number of ghosts to visit Anya, the duration of a candle's burning and the minimum number of candles that should burn during each visit. 

The next line contains m space-separated numbers w_{i} (1 ≤ i ≤ m, 1 ≤ w_{i} ≤ 300), the i-th of them repesents at what second after the midnight the i-th ghost will come. All w_{i}'s are distinct, they follow in the strictly increasing order.


-----Output-----

If it is possible to make at least r candles burn during each visit, then print the minimum number of candles that Anya needs to light for that.

If that is impossible, print  - 1.


-----Examples-----
Input
1 8 3
10

Output
3

Input
2 10 1
5 8

Output
1

Input
1 1 3
10

Output
-1



-----Note-----

Anya can start lighting a candle in the same second with ghost visit. But this candle isn't counted as burning at this visit.

It takes exactly one second to light up a candle and only after that second this candle is considered burning; it means that if Anya starts lighting candle at moment x, candle is buring from second x + 1 to second x + t inclusively.

In the first sample test three candles are enough. For example, Anya can start lighting them at the 3-rd, 5-th and 7-th seconds after the midnight.

In the second sample test one candle is enough. For example, Anya can start lighting it one second before the midnight.

In the third sample test the answer is  - 1, since during each second at most one candle can burn but Anya needs three candles to light up the room at the moment when the ghost comes.

Difficulty: interview

Starter code:

Solutions:
"""
Codeforces Contest 288 Div 2 Problem C

Author  : chaotic_iak
Language: Python 3.4.2
"""

################################################### SOLUTION

def main():
    m,t,r = read()
    w = read()
    if t < r: return -1
    covers = [0]*1000
    ct = 0
    for i in w:
        x = covers[i]
        for j in range(r-x):
            for k in range(t):
                covers[i-j+k] += 1
            ct += 1
    return ct



#################################################### HELPERS



def read(mode=2):
    # 0: String
    # 1: List of strings
    # 2: List of integers
    inputs = input().strip()
    if mode == 0: return inputs
    if mode == 1: return inputs.split()
    if mode == 2: return list(map(int, inputs.split()))

def write(s="\n"):
    if s is None: s = ""
    if isinstance(s, list): s = " ".join(map(str, s))
    s = str(s)
    print(s, end="")

write(main())

import sys
import math

m, t, r = map(int, input().split())

if r > t:
    print(-1)
    return
    
candles = []    
gh = list(map(int, input().split()))

for i in range(m):
    g = gh[i]
    now_on = 0
    for c in candles:
        if g - c <= t:
            now_on += 1
    
    for k in range(r - now_on):
        candles.append(g - 1 - k)
        
print(len(candles))

import collections

m, t, r = list(map(int, input().split()))
w = list(map(int, input().split()))

result = 0
current = collections.deque()
used = set()

def main():
    nonlocal result, current
    for ghost in w:
        while current and current[0] < ghost:
            current.popleft()
        required = r - len(current)
        result += required
        moment = ghost
        for i in range(required):
            moment -= 1
            while moment in used:
                moment -= 1
            if ghost - moment > t:
                print(-1)
                return
            used.add(moment)
            current.append(moment + t)
        current = collections.deque(sorted(current))
    print(result)

main()


m, t, r = map(int, input().split())
data = list(map(int, input().split()))

if r > t:
    print(-1)
else:
    candles = []
    total = 0

    for x in data:
        while candles and candles[0] + t - 1 < x:
            candles.pop(0)

        need = r - len(candles)

        for n in range(need):
            candles.append(x - (need - 1) + n)
            total += 1

    print(total)

M,T,R = [int(x) for x in input().split()]
W = [int(x) for x in input().split()]
W.sort()
if T<R:
    print(-1)
    return
candle_cnt = 0
candles_num = [0 for i in range(601)]
for w in W:
    for i in range(R):
        if candles_num[w]<R:
            for j in range(w-i,w-i+T):
                candles_num[j] += 1
            candle_cnt += 1
        else:
            break
print(candle_cnt)

import math
import sys

debug = False

if debug:
    fin = open('input.txt', 'r')
    fout = open('output.txt', 'w')
else:
    fin = sys.stdin
    fout = sys.stdout

s = fin.readline()
m, t, r = list(map(int, s.split()))

if r > t:
    fout.write('-1')
    return

s = fin.readline()
w = list(map(int, s.split()))

ans = r
ar = [w[0] - r + i for i in range(r)]
for i in range(1, m):
    while ar and w[i] - ar[0] > t:
        ar.pop(0)
    ans += r - len(ar)
    b = r - len(ar)
    for j in range(b):
        ar.append(w[i] - b + j)

fout.write(str(ans))


m, t, r = map(int, input().split())
w = list(map(int, input().split()))
w.sort()
cur = set()
cur1 = set()
cnt = 0

for i in range(m):
    for j in cur:
        if j + t >= w[i]:
            cur1.add(j)
    cur = set()
    for j in cur1:
        cur.add(j)
    cur1 = set()

    j = w[i] - 1
    while j >= w[i] - t and len(cur) < r:
        if not j in cur:
            cur.add(j)
            cnt += 1
        j -= 1

    if len(cur) < r:
        print(-1)
        return

print(cnt)

m,t,r=input().split(' ')
m=int(m)
t=int(t)
r=int(r)
if t<r:
    input()
    need=-1
else:
    candles=[]
    need=r
    ghosts=input().split(' ')
    for i in range(r):
        candles.append(t-i)
    for i in range(len(ghosts)-1):
        dead=[]
        diff=int(ghosts[i+1])-int(ghosts[i])
        for j in range(len(candles)):
            candles[j]=max(candles[j]-diff,0)
            if candles[j] is 0:
                dead.append(candles[j])
        for candle in dead:
            candles.remove(0)
        need+=r-len(candles)
        for k in range(r-len(candles)):
            candles.append(t-k)
print(need)

m,t,r = [int(x) for x in input().strip().split()]
ghosts = [int(x) for x in input().strip().split()]

candles = [ ghosts[0]-1-x+t for x in range(0,r) ]
usedTimes = [ ghosts[0]-1-x for x in range(0,r) ]
res = r

#print(candles)
for i in range(0,m):

    for j in range(0,r):

        candleTime = candles[j]
        if candleTime < ghosts[i]:

            possibleTime = ghosts[i] - 1
            canFindTime = False
            while possibleTime >= ghosts[i] - t:

                if usedTimes.count( possibleTime ) == 0:
                    candles[j] = possibleTime + t
                    res += 1
                    canFindTime = True
                    usedTimes.append( possibleTime )
                    break
                else:
                    possibleTime -= 1

            if not canFindTime:
                res = -1
                break

    if res == -1:
        break

print(res)


m, t, r = map(int, input().split())
arr = [int(x) for x in input().split()]
arr.reverse()

ans, tmp = 0, [0 for _ in range(620)]
for i in range(len(arr)):

    candles = 0
    for j in range(arr[i]-1+310, arr[i]-t-1+310, -1):
        if tmp[j] == 1:
            candles += 1
    
    for j in range(arr[i]-t+310, arr[i]+310):
        if candles >= r:
            break
        if tmp[j] == 0:
            tmp[j] = 1
            candles += 1
            ans += 1
            #print(j-310)

    if candles < r:
        ans = -1
        break

print(ans)

def main():
    m, t, r = list(map(int, input().split()))
    gh = sorted(map(int, input().split()), reverse=True)
    if r > t:
        print(-1)
        return
    l = [False] * 600
    for g in gh:
        g -= t
        for i in range(g, g + r - sum(l[i] for i in range(g, g + t))):
            l[i] = True
    print(sum(l))


def __starting_point():
    main()

__starting_point()

a,b,c = map(int,input().split())
t=sorted(map(int,input().split()),reverse=True)
if c>b:
    print('-1')
else:
    q=[False]*600
    for k in t:
        k=k-b
        for j in range(k,k+c-sum(q[i] for i in range(k,k+b))):
            q[j]=True
    print(sum(q))

(m,t,r)=input().split(sep=None, maxsplit=300)
(m,T,r)=(int(m),int(t),int(r))
x=input().split(sep=None, maxsplit=m)
k=r
out=set([])
u=[int(x[0])+T-1-i for i in range(r)]
out|=set(u)
key=True
for i in range(m):
    if not key:
        break
    v=int(x[i])
    t=v+T-1
    for j in range(r):
        if v<=u[j]:
            continue
        while t in out and t>=v:
            t-=1
        if t<v:
            key=False
            break
        else:
            out|=set([t])
            u[j]=t
            k+=1
            t-=1
if(key):
    print(k)
else:
    print(-1)

m, t, r = map(int, input().split())
if t < r:
    print(-1)
    return
w, l, v = list(map(int, input().split())), [r] * m, 0
for i in range(m):
    for j in range(l[i]):
        v += 1
        for k in range(i + 1, m):
            if w[i] - j - 1 + t < w[k]:
                break
            l[k] -= 1
print(v)

m,t,r = map(int, input().split())
w = list(map(int, input().split()))

if r > t:
    print(-1); return;
    
candles = []
for i in range(m):
    ct = 0
    for c in candles:
        if w[i] - c <= t:
            ct += 1
    for k in range(r - ct):
        candles.append(w[i] - k - 1)
print(len(candles))

m, t, r = [int(i) for i in input().split()]
w = [int(i) for i in input().split()]
if r > t:
    print(-1)
    return
candles = list(range(w[0]-r,w[0]))
ans = r
for i in range(1,len(w)):
    candles = [candle for candle in candles if candle >= w[i]-t]
    dis = r-len(candles)
    candles += list(range(w[i]-dis,w[i]))
    ans += dis
print(ans)


import sys

limit = 300

m, span, need = list(map(int, input().split()))
visits = list(map(int, input().split()))
if need > span:
    print(-1)
    return

result = 0
count = (limit + 1) * [ 0 ]
for visit in visits:
    for i in range(need - count[visit]):
        for pos in range(max(0, visit - i), min(visit - i + span, limit + 1)):
            count[pos] += 1
        result += 1
print(result)


import sys

ghosts, duration, candles = input().split()
arrival = input().split()
burn = []
for j in range(len(arrival)):
    time = int(arrival[len(arrival) - 1 - j])
    candle = int(candles)
    if len(burn) != 0:
        for k in range(len(burn)):
            if burn[k] <= time:
                candle -= 1
    for i in range(candle):
        burn.append(time - int(duration) + 1 + i)
    if burn[-1] > time:
        print('-1')
        return
print(len(burn))


f = lambda: list(map(int, input().split()))
m, t, r = f()
p, s = [], 0
for w in f():
    p = [q for q in p if q > w]
    d = r - len(p)
    p += [w + t - i for i in range(d)]
    s += d
print(-1 if t < r else s)

f = lambda: list(map(int, input().split()))
m, t, r = f()
p, s = [], 0
for w in f():
    p = [q for q in p if q > w]
    d = r - len(p)
    p += [w + t - i for i in range(d)]
    s += d
print(-1 if t < r else s)


f = lambda: list(map(int, input().split()))
m, t, r = f()
p, s = [], 0
for w in f():
    p = [q for q in p if q > w]
    d = r - len(p)
    p += [w + t - i for i in range(d)]
    s += d
print(-1 if t < r else s)


f = lambda: list(map(int, input().split()))
m, t, r = f()
p, s = [], 0
for w in f():
    p = [q for q in p if q > w]
    d = r - len(p)
    p += [w + t - i for i in range(d)]
    s += d
print(-1 if t < r else s)


f = lambda: list(map(int, input().split()))
m, t, r = f()
p, s = [], 0
for w in f():
    p = [q for q in p if q > w]
    d = r - len(p)
    p += [w + t - i for i in range(d)]
    s += d
print(-1 if t < r else s)


f = lambda: list(map(int, input().split()))
m, t, r = f()
p, s = [], 0
for w in f():
    p = [q for q in p if q > w]
    d = r - len(p)
    p += [w + t - i for i in range(d)]
    s += d
print(-1 if t < r else s)