#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while ('0' <= ch && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x * f;
}
int T, D, n;
long long C;
struct node {
  int x, c;
} q[200009];
bool cmp(node a, node b) { return a.x < b.x; }
int main() {
  T = read(), D = read(), n = read();
  for (int i = 1; i <= n; i++) q[i].x = read(), q[i].c = read();
  sort(q + 1, q + 1 + n, cmp);
  q[n + 1].x = T;
  n++;
  int now = 0, nd = 0;
  while (now != n) {
    int g = now, mn = 0;
    while (g < n && q[g + 1].x <= q[now].x + D) {
      g++;
      if (!mn || q[mn].c > q[g].c) mn = g;
      if (q[now].c >= q[g].c) break;
    }
    if (g == now) {
      puts("-1");
      return 0;
    }
    if (q[now].c <= q[mn].c)
      C += 1LL * (D - nd) * q[now].c, nd = D;
    else
      C += 1LL * (q[mn].x - q[now].x - nd) * q[now].c, nd = q[mn].x - q[now].x;
    nd -= q[mn].x - q[now].x, now = mn;
  }
  printf("%I64d\n", C);
  return 0;
}
