#include <bits/stdc++.h>
using namespace std;
struct edge {
  int y, c, f, next;
  edge() {}
  edge(int y_, int c_, int f_, int n_) { y = y_, c = c_, f = f_, next = n_; }
} e[100500];
int head[2505];
int nn, mm;
int phi[2505], q[2505];
int s_, t_, cost_;
bool v[2505];
bool spfa(int s) {
  int to, tail = 1, front = 0;
  for (int i = 1; i <= nn; i++) v[i] = 0, phi[i] = 0x3fffffff;
  phi[s] = 0;
  q[0] = s;
  while (tail != front) {
    s = q[front++];
    v[s] = 0;
    if (front > nn) front = 0;
    for (int i = head[s]; ~i; i = e[i].next)
      if (e[i ^ 1].c && phi[to = e[i].y] > phi[s] - e[i].f) {
        phi[to] = phi[s] - e[i].f;
        if (v[to] == 0) {
          v[to] = 1;
          if (phi[to] < phi[q[front]])
            front == 0 ? front = nn : front--, q[front] = to;
          else
            q[tail++] = to, tail > nn ? tail = 0 : 0;
        }
      }
  }
}
inline bool relable() {
  int d = 0x3fffffff;
  for (int i = 1; i <= nn; i++)
    if (v[i])
      for (int j = head[i]; ~j; j = e[j].next)
        if (!v[e[j].y] && e[j].c) d = min(d, phi[e[j].y] + e[j].f - phi[i]);
  if (d == 0x3fffffff) return 0;
  for (int i = 1; i <= nn; i++)
    if (v[i]) phi[i] += d;
  return 1;
}
inline int aug(int s, int flow) {
  if (s == t_) return cost_ += phi[s_] * flow, flow;
  int res = flow, te;
  v[s] = 1;
  for (int i = head[s]; ~i; i = e[i].next)
    if (!v[e[i].y] && e[i].c && phi[s] == phi[e[i].y] + e[i].f) {
      res -= (te = aug(e[i].y, min(res, e[i].c)));
      e[i].c -= te;
      e[i ^ 1].c += te;
      if (!res) return flow;
    }
  return flow - res;
}
int cost_flow(int s, int t) {
  spfa(t);
  cost_ = 0;
  s_ = s;
  t_ = t;
  do memset(v, 0, sizeof(v));
  while (aug(s, 0x3fffffff) || relable());
  return cost_;
}
inline void add(int x, int y, int c, int f) {
  e[mm] = edge(y, c, f, head[x]);
  head[x] = mm++;
  e[mm] = edge(x, 0, -f, head[y]);
  head[y] = mm++;
}
int a[500];
int main() {
  int m, t, r;
  scanf("%d%d%d", &m, &t, &r);
  for (int i = 0; i < m; i++) scanf("%d", a + i);
  if (t < r)
    puts("-1");
  else {
    int las = 0, f = 0;
    for (int i = 0; i < m; i++)
      if (a[i] - las - 1 < r) {
        f = 1;
        break;
      }
    nn = 900;
    mm = 0;
    int ss = ++nn;
    int tt = ++nn;
    for (int i = 1; i <= nn; i++) head[i] = -1;
    for (int i = 1; i <= 900; i++) add(i, i + 1, 0x3fffffff, 0);
    for (int i = -300; i < 300; i++) add(i + t + 1 + 301, i + 1 + 301, 1, 1);
    for (int i = 0; i < m; i++)
      add(ss, a[i] + 302, r, 0), add(a[i] + 301, tt, r, 0);
    printf("%d\n", cost_flow(ss, tt));
  }
  return 0;
}
