#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200 * 1000 + 7;
struct myEvent {
  int pos;
  bool add;
  int id;
  myEvent(int _pos, bool _add, int _id) {
    pos = _pos;
    add = _add;
    id = _id;
  }
};
bool cmp(myEvent x, myEvent y) {
  if (x.pos != y.pos) return x.pos < y.pos;
  return x.add;
}
int pos[MAXN], cost[MAXN];
int main() {
  int d, n;
  scanf("%d%d", &d, &n);
  int m;
  scanf("%d", &m);
  vector<myEvent> ev;
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &pos[i], &cost[i]);
    ev.push_back(myEvent(pos[i], true, i));
    ev.push_back(myEvent(pos[i] + n, false, i));
  }
  ev.push_back(myEvent(d, true, m + 1));
  ev.push_back(myEvent(n, false, 0));
  long long ans = 0, pos = 0;
  multiset<long long> go;
  go.insert(0);
  sort(ev.begin(), ev.end(), cmp);
  for (int i = 0; i < (int)ev.size(); i++) {
    if (go.size() == 0) {
      printf("-1\n");
      return 0;
    }
    ans += 1LL * (ev[i].pos - pos) * (*go.begin());
    pos = ev[i].pos;
    if (ev[i].pos == d) {
      printf("%lld\n", ans);
      return 0;
    }
    if (ev[i].add) {
      go.insert(cost[ev[i].id]);
    } else {
      go.erase(go.find(cost[ev[i].id]));
    }
  }
  printf("-1\n");
  return 0;
}
