#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
long long ans;
const int M = 2e5 + 10;
struct no {
  int num, w;
};
deque<no> q;
int tol;
struct aa {
  int x, w;
  bool operator<(const aa& b) const { return x < b.x; }
} a[M];
int main() {
  int d, n, m;
  cin >> d >> n >> m;
  int now = 0;
  int ok = 1;
  for (int i = 0; i < m; i++) scanf("%d%d", &a[i].x, &a[i].w);
  sort(a, a + m);
  for (int i = 0; i < m; i++) {
    if (a[i].x - now > n) ok = 0;
    now = a[i].x;
  }
  if (d - now > n) ok = 0;
  if (!ok) {
    puts("-1");
    return 0;
  }
  now = 0;
  q.push_back(no{n, 0});
  for (int i = 0; i < m; now = a[i].x, i++) {
    tol = n;
    int tmp = a[i].x - now;
    while (tmp) {
      no tm = q.front();
      q.pop_front();
      if (tm.num >= tmp) {
        tol -= tmp;
        ans += tmp * (long long)tm.w;
        tm.num -= tmp;
        q.push_front(tm);
        tmp = 0;
      } else {
        tol -= tm.num;
        ans += tm.num * (long long)tm.w;
        tmp -= tm.num;
      }
    }
    while (!q.empty()) {
      no tm = q.back();
      if (tm.w > a[i].w) {
        q.pop_back();
        tol -= tm.num;
      } else
        break;
    }
    q.push_back(no{n - tol, a[i].w});
  }
  int tmp = d - now;
  while (tmp) {
    no tm = q.front();
    q.pop_front();
    if (tm.num >= tmp) {
      ans += tmp * (long long)tm.w;
      tmp = 0;
    } else {
      ans += tm.num * (long long)tm.w;
      tmp -= tm.num;
    }
  }
  cout << ans << endl;
  return 0;
}
