#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
pair<int, int> p[maxn];
struct node {
  int x, y;
  friend bool operator<(const node& a, const node& b) {
    if (a.y == b.y) return a.x > b.x;
    return a.y > b.y;
  }
};
priority_queue<node> Q;
int main() {
  int d, n, m;
  scanf("%d%d%d", &d, &n, &m);
  for (int i = 1; i <= m; i++) scanf("%d%d", &p[i].first, &p[i].second);
  p[m + 1] = make_pair(d, 0);
  sort(p + 1, p + 1 + m);
  long long ans = 0;
  Q.push(node{0, 0});
  for (int i = 0; i <= m; i++) {
    int now = p[i].first;
    int dis = p[i + 1].first - p[i].first;
    if (dis > n) return puts("-1");
    while (dis) {
      while (Q.size() && Q.top().x + n <= now) Q.pop();
      node G = Q.top();
      int d = min(dis, n - (now - G.x));
      dis -= d;
      ans += 1ll * d * G.y;
      now += d;
    }
    Q.push(node{p[i + 1].first, p[i + 1].second});
  }
  printf("%lld\n", ans);
}
