#include <bits/stdc++.h>
using namespace std;
long long d, n, m;
vector<pair<long long, long long> > g;
const long long INVAL = 1e12;
long long tree[4000004];
inline long long left(long long x) { return x << 1; }
inline long long right(long long x) { return (x << 1) + 1; }
void upd(long long id, long long x, long long l, long long r, long long val) {
  if (l == r) {
    tree[id] = val;
    return;
  }
  long long mid = (l + r) / 2;
  if (x <= mid)
    upd(left(id), x, l, mid, val);
  else {
    upd(right(id), x, mid + 1, r, val);
  }
  tree[id] = min(tree[left(id)], tree[right(id)]);
}
long long qry(long long id, long long x, long long y, long long l,
              long long r) {
  long long mid = (l + r) >> 1;
  if (x > r || y < l) return INVAL;
  if (l >= x && r <= y) return tree[id];
  long long X = qry(left(id), x, y, l, mid);
  long long Y = qry(right(id), x, y, mid + 1, r);
  if (X == INVAL)
    return Y;
  else if (Y == INVAL)
    return X;
  else {
    return min(X, Y);
  }
}
long long nxt[200005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> d >> n >> m;
  for (long long i = 0; i < 4000004; i++) tree[i] = INVAL;
  for (long long i = 1; i <= m; i++) {
    long long x, p;
    cin >> x >> p;
    g.push_back(make_pair(x, p));
  }
  sort(g.begin(), g.end());
  upd(1, 0, 0, 1000001, d);
  for (long long i = m - 1; i >= 0; i--) {
    long long curp = g[i].second;
    long long curx = g[i].first;
    long long qq = qry(1, 0, curp, 0, 1000001);
    nxt[i] = qq;
    upd(1, curp, 0, 1000001, curx);
  }
  long long curb = n - g[0].first;
  if (curb < 0) {
    cout << "-1\n";
    return 0;
  }
  g.push_back(make_pair(d, 0));
  long long ans = 0;
  for (long long i = 0; i < m; i++) {
    long long curp = g[i].second;
    long long curx = g[i].first;
    long long buys = min(n, nxt[i] - curx);
    if (buys > curb) {
      ans += (buys - curb) * curp;
      curb = buys;
    }
    curb -= g[i + 1].first - curx;
    if (curb < 0) {
      cout << "-1\n";
      return 0;
    }
  }
  cout << ans << endl;
  return 0;
}
