#include <bits/stdc++.h>
using namespace std;
struct place {
  int x, p;
} v[200010];
bool cmp(place a, place b) { return a.x < b.x; }
int n, d, m;
long long ans;
priority_queue<pair<int, int>, vector<pair<int, int> >,
               greater<pair<int, int> > >
    H;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> d >> n >> m;
  for (int i = 1; i <= m; ++i) {
    cin >> v[i].x >> v[i].p;
  }
  v[++m].x = d;
  sort(v + 1, v + m + 1, cmp);
  int i = 1;
  while (v[i].x <= n && i <= m) {
    H.push(make_pair(v[i].p, i));
    ++i;
  }
  int where = n;
  while (!H.empty() && where < d) {
    int wh = H.top().second;
    int extra = min(n - (where - v[wh].x), v[i].x - where);
    if (extra == n - (where - v[wh].x)) H.pop();
    if (extra > 0) {
      ans += 1LL * extra * v[wh].p;
      where += extra;
    }
    if (where >= v[i].x) {
      H.push(make_pair(v[i].p, i));
      ++i;
    }
  }
  if (where < d) {
    cout << -1;
  } else {
    cout << ans;
  }
}
