#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int maxn = 200005;
vector<pair<int, int> > a;
vector<int> p;
struct SegTree {
  int l, r, mi;
  int mid() { return (l + r) >> 1; }
} tree[maxn << 2];
void push_up(int rt) {
  tree[rt].mi = min(tree[rt << 1].mi, tree[rt << 1 | 1].mi);
}
void build(int l, int r, int rt) {
  tree[rt].l = l;
  tree[rt].r = r;
  tree[rt].mi = 0;
  if (l == r) {
    tree[rt].mi = a[l - 1].second;
    return;
  }
  int mid = (l + r) >> 1;
  build(l, mid, rt << 1);
  build(mid + 1, r, rt << 1 | 1);
  push_up(rt);
}
int query(int l, int r, int rt) {
  if (l <= tree[rt].l && tree[rt].r <= r) {
    return tree[rt].mi;
  }
  int mid = tree[rt].mid();
  int mi = INF;
  if (l <= mid) mi = min(mi, query(l, r, rt << 1));
  if (mid < r) mi = min(mi, query(l, r, rt << 1 | 1));
  return mi;
}
int main() {
  int d, n, m, x, pp;
  scanf("%d%d%d", &d, &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &x, &pp);
    a.push_back(make_pair(x, pp));
    p.push_back(x);
  }
  a.push_back(make_pair(0, 0));
  a.push_back(make_pair(d, 0));
  p.push_back(0);
  p.push_back(d);
  sort(a.begin(), a.end());
  sort(p.begin(), p.end());
  build(1, a.size(), 1);
  int now = n, j, c;
  long long cost = 0;
  for (int i = 0; i < a.size() - 1; i++) {
    int pos = upper_bound(p.begin(), p.end(), a[i].first + n) - p.begin();
    if (pos - (i + 1) <= 0) {
      cost = -1;
      break;
    }
    int mi = query(i + 2, pos, 1);
    if (mi >= a[i].second) {
      cost += (long long)(n - now) * a[i].second;
      now = n - (a[i + 1].first - a[i].first);
    } else {
      j = i + 1;
      while (a[j].second >= a[i].second) j++;
      c = a[j].first - a[i].first;
      if (c <= now)
        now -= c;
      else {
        cost += (long long)(c - now) * a[i].second;
        now = 0;
      }
      i = j - 1;
    }
  }
  cout << cost << endl;
  return 0;
}
