#include <bits/stdc++.h>
using namespace std;
typedef int64_t ll;
int main(int argc, char **argv) {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0), cout.precision(15);
  int d, n, m;
  cin >> d >> n >> m;
  vector<pair<int, int> > xp(m);
  for (int i = 0; i < m; i++) {
    cin >> xp[i].first >> xp[i].second;
  }
  sort(xp.begin(), xp.end());
  const int INF = 1000000 + 1;
  ll cost = 0;
  int r = n;
  int l = 0;
  int nxt_sta = 0;
  priority_queue<pair<int, int> > Q;
  while (r < d) {
    while ((nxt_sta < m) && (xp[nxt_sta].first <= r)) {
      Q.push(make_pair(-xp[nxt_sta].second, xp[nxt_sta].first));
      nxt_sta++;
    }
    while (Q.size() && (Q.top().second < l)) {
      Q.pop();
    }
    if (Q.empty()) {
      break;
    }
    ll price = -Q.top().first;
    l = Q.top().second;
    int nxt_r = l + n;
    for (int pos = nxt_sta; pos < m; pos++) {
      if (xp[pos].first > nxt_r) {
        break;
      }
      if (xp[pos].second <= price) {
        nxt_r = xp[pos].first;
        break;
      }
    }
    nxt_r = min(nxt_r, d);
    cost += price * (nxt_r - r);
    r = nxt_r;
    Q.pop();
  }
  if (r >= d) {
    cout << cost << endl;
  } else {
    cout << -1 << endl;
  }
  return 0;
}
