#include <bits/stdc++.h>
inline int read() {
  register int x = 0;
  register int y = 0;
  register char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') y = 1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - 48, c = getchar();
  return y ? -x : x;
}
int d, n, m;
int x[200006], p[200006];
int nex[200006];
struct data {
  int x, p;
} A[200006];
struct node {
  int x, p;
};
std::priority_queue<node> que;
inline int operator<(node a, node b) {
  return a.p == b.p ? a.x > b.x : a.p > b.p;
}
inline int cmp(data a, data b) { return a.x < b.x; }
int main() {
  d = read();
  n = read();
  m = read();
  for (register int i = 1; i <= m; i++) A[i].x = read(), A[i].p = read();
  std::sort(A + 1, A + 1 + m, cmp);
  for (register int i = 1; i <= m; i++) x[i] = A[i].x, p[i] = A[i].p;
  x[m + 1] = d;
  long long ans = 0;
  que.push((node){0, 0});
  for (register int now, dis, i = 0; i <= m; i++) {
    now = x[i];
    dis = x[i + 1] - now;
    if (dis > n) return puts("-1"), 0;
    while (dis) {
      while (!que.empty() && que.top().x + n <= now) que.pop();
      int d = std::min(dis, n - (now - que.top().x));
      dis -= d;
      now += d;
      ans += (long long)d * que.top().p;
    }
    que.push((node){x[i + 1], p[i + 1]});
  }
  printf("%lld", ans);
  return 0;
}
