#include <bits/stdc++.h>
using namespace std;
struct gas {
  long long price, pos;
};
struct cmp_price {
  bool operator()(gas a, gas b) { return a.price > b.price; }
};
bool cmp_pos(gas a, gas b) { return a.pos < b.pos; }
int main() {
  ios::sync_with_stdio(false);
  vector<gas> stations;
  priority_queue<gas, vector<gas>, cmp_price> pq;
  long long d, n, m;
  cin >> d >> n >> m;
  gas input;
  for (long long i = 0; i < m; i++) {
    cin >> input.pos >> input.price;
    stations.push_back(input);
  }
  input.pos = 0;
  input.price = 0;
  stations.push_back(input);
  input.pos = d;
  input.price = 0;
  stations.push_back(input);
  sort(stations.begin(), stations.end(), cmp_pos);
  long long ans = 0;
  long long cur_pos = 0, last_pos = 0;
  for (long long i = 0; i < m + 2; i++) {
    stations[i].pos += n;
    pq.push(stations[i]);
    cur_pos = min(stations[i + 1].pos, pq.top().pos);
    ans += pq.top().price * (cur_pos - last_pos);
    last_pos = cur_pos;
    if (cur_pos == d) {
      cout << ans;
      return 0;
    }
    while (stations[i + 1].pos > cur_pos and cur_pos == pq.top().pos) {
      while (pq.top().pos <= cur_pos) {
        pq.pop();
        if (pq.empty()) {
          cout << -1;
          return 0;
        }
      }
      cur_pos = min(stations[i + 1].pos, pq.top().pos);
      ans += pq.top().price * (cur_pos - last_pos);
      last_pos = cur_pos;
      if (cur_pos == d) {
        cout << ans;
        return 0;
      }
    }
  }
  cout << ans;
  return 0;
}
