#include <bits/stdc++.h>
using namespace std;
const long long M = 200005;
struct Station {
  long long pos, cost;
} s[M];
struct Node {
  long long pos, cost;
  friend bool operator<(const Node &a, const Node &b) {
    if (a.cost == b.cost)
      return a.pos > b.pos;
    else
      return a.cost > b.cost;
  }
};
long long L, n, m, now, dis, d, ans;
priority_queue<Node> Q;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
inline bool mycmp(Station x, Station y) {
  return ((x.pos < y.pos) || ((x.pos == y.pos) && (x.cost < y.cost)));
}
signed main() {
  L = read(), n = read(), m = read();
  for (long long i = 1; i <= m; i++) s[i].pos = read(), s[i].cost = read();
  s[m + 1] = (Station){L, 0};
  sort(s + 1, s + m + 1, mycmp);
  ans = 0;
  Q.push((Node){0, 0});
  for (long long i = 0; i <= m; i++) {
    now = s[i].pos;
    dis = s[i + 1].pos - s[i].pos;
    if (dis > n) {
      printf("-1\n");
      return 0;
    }
    while (dis) {
      while ((Q.size()) && (Q.top().pos + n <= now)) Q.pop();
      Node Top = Q.top();
      d = min(dis, n - (now - Top.pos));
      dis -= d;
      ans += 1ll * d * Top.cost;
      now += d;
    }
    Q.push((Node){s[i + 1].pos, s[i + 1].cost});
  }
  printf("%lld\n", ans);
  return 0;
}
