#include <bits/stdc++.h>
using namespace std;
int d, k, n;
pair<int, int> w[200005];
int p[200005];
stack<int> s;
int main() {
  scanf("%d%d%d", &d, &k, &n);
  for (int i = 0; i < n; ++i) {
    int x, c;
    scanf("%d%d", &x, &c);
    w[i] = make_pair(x, c);
  }
  sort(w, w + n);
  w[n] = make_pair(d, -1);
  s.push(n);
  for (int i = n - 1; i >= 0; --i) {
    while (w[s.top()].second >= w[i].second) s.pop();
    p[i] = s.top();
    s.push(i);
  }
  int t = k - w[0].first, i = 0;
  long long r = 0;
  for (int i = 0; t >= 0 && i < n; ++i) {
    if (w[p[i]].first - w[i].first > t) {
      int q = min(w[p[i]].first - w[i].first, k) - t;
      r += 1LL * q * w[i].second;
      t += q;
    }
    t -= w[i + 1].first - w[i].first;
  }
  cout << (t < 0 ? -1 : r) << endl;
  return 0;
}
