#include <bits/stdc++.h>
using namespace std;
int d, n, m;
struct P {
  int x, c;
} p[200005];
bool cmp(P a, P b) { return a.x < b.x; }
int mn[200005 << 2];
inline void pushup(int t) {
  if (p[mn[t << 1]].c < p[mn[t << 1 | 1]].c)
    mn[t] = mn[t << 1];
  else
    mn[t] = mn[t << 1 | 1];
}
void build(int t, int l, int r) {
  if (l == r) {
    mn[t] = l;
    return;
  }
  int mid = l + r >> 1;
  build(t << 1, l, mid);
  build(t << 1 | 1, mid + 1, r);
  pushup(t);
}
int ask(int t, int l, int r, int L, int R) {
  if (l >= L && r <= R) return mn[t];
  int mid = l + r >> 1;
  if (mid < L) return ask(t << 1 | 1, mid + 1, r, L, R);
  if (mid + 1 > R) return ask(t << 1, l, mid, L, R);
  int t1 = ask(t << 1 | 1, mid + 1, r, L, R), t2 = ask(t << 1, l, mid, L, R);
  if (p[t1].c < p[t2].c) return t1;
  return t2;
}
long long calc(int l, int r) {
  if (l == r) return 0;
  if (l + 1 == r) return 0;
  if (p[r].x - p[l].x <= n) return 0;
  int mn = ask(1, 1, m, l + 1, r - 1);
  long long ret = 0;
  if (p[l].x + n < p[mn].x) ret = calc(l, mn);
  if (p[mn].x + n >= p[r].x) {
    ret += (p[r].x - p[mn].x - max(0, n - (p[mn].x - p[l].x))) *
           (long long)p[mn].c;
    return ret;
  }
  ret += (n - max(0, n - (p[mn].x - p[l].x))) * (long long)p[mn].c;
  ret += calc(mn, r);
  return ret;
}
int main() {
  scanf("%d%d%d", &d, &n, &m);
  for (int i = 1; i <= m; i++) scanf("%d%d", &p[i].x, &p[i].c);
  p[++m].x = 0;
  p[m].c = 1 << 29;
  p[++m].x = d;
  p[m].c = 1 << 29;
  sort(p + 1, p + m + 1, cmp);
  for (int i = 1; i < m; i++)
    if (p[i].x + n < p[i + 1].x) {
      puts("-1");
      return 0;
    }
  p[0].c = 1 << 30;
  build(1, 1, m);
  cout << calc(1, m) << endl;
  return 0;
}
