#include <bits/stdc++.h>
using namespace std;
struct event {
  long long x;
  long long id, cost;
  bool beg;
};
event events[400111];
long long L = 0;
bool flag = false;
long long d, n, m;
set<pair<long long, long long> > myset;
set<pair<long long, long long> >::iterator myit;
long long x[200111];
long long p[200111];
bool SE(event a, event b) { return a.x < b.x; }
long long Solve(long long L, long long R) {
  if (L == R) return 0;
  if (myset.empty()) {
    flag = true;
    return 0;
  }
  long long costperliter = (*myset.begin()).first;
  return costperliter * (long long)(R - L);
}
signed main() {
  long long i;
  long long lastplace;
  long long ans = 0;
  cin >> d >> n >> m;
  for (i = 1; i <= m; i++) {
    cin >> x[i] >> p[i];
    L++;
    events[L].beg = true;
    events[L].x = x[i];
    events[L].id = i;
    events[L].cost = p[i];
    L++;
    events[L].beg = false;
    events[L].id = i;
    events[L].cost = p[i];
    events[L].x = x[i] + n;
  }
  L++;
  events[L].x = n;
  events[L].beg = false;
  events[L].cost = 0;
  events[L].id = 0;
  L++;
  events[L].x = d;
  events[L].beg = true;
  sort(events + 1, events + 1 + L, SE);
  myset.insert(make_pair(0, 0));
  lastplace = 0;
  for (i = 1; i <= L; i++) {
    if (events[i].beg) {
      ans += Solve(lastplace, events[i].x);
      lastplace = events[i].x;
      if (flag) {
        cout << "-1\n";
        return 0;
      }
      if (events[i].x == d) break;
      myset.insert(make_pair(events[i].cost, events[i].id));
    } else {
      ans += Solve(lastplace, events[i].x);
      lastplace = events[i].x;
      if (flag) {
        cout << "-1\n";
        return 0;
      }
      myset.erase(make_pair(events[i].cost, events[i].id));
    }
  }
  cout << ans << '\n';
  return 0;
}
