#include <bits/stdc++.h>
using namespace std;
int main() {
  int d, n, m;
  long long res = 0, cur = 0, qe;
  pair<int, int> *vp;
  int *lix, *q;
  scanf("%d %d %d", &d, &n, &m);
  vp = new pair<int, int>[m + 2];
  for (auto i = 0; i < m; i++) {
    scanf("%d %d", &vp[i].first, &vp[i].second);
  }
  cur = n;
  vp[m] = pair<int, int>(d, 0);
  vp[m + 1] = pair<int, int>(0, 0);
  lix = new int[m + 2]();
  q = new int[m + 1]();
  qe = 0;
  q[qe++] = m + 1;
  sort(vp, vp + m + 2);
  for (int i = m; i >= 0; i--) {
    while (qe && vp[i].second < vp[q[qe - 1]].second) qe--;
    lix[i] = q[qe - 1];
    q[qe++] = i;
  }
  for (int i = 1; i < m + 2; i++) {
    cur -= vp[i].first - vp[i - 1].first;
    if (cur < 0) {
      res = -1;
      break;
    }
    if (i < m + 1) {
      qe = min(n - cur, vp[lix[i]].first - vp[i].first - cur);
      if (qe > 0) {
        res += qe * vp[i].second;
        cur += qe;
      }
    }
  }
  cout << res << endl;
  return 0;
}
