#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long d, n, m;
  cin >> d >> n >> m;
  vector<pair<long long, long long> > x(m + 1);
  x[0] = {0, LLONG_MAX};
  for (long long i = 0; i < m; i++) {
    cin >> x[i + 1].first >> x[i + 1].second;
  }
  sort(x.begin(), x.end());
  x.emplace_back(d, 0);
  if (d <= n) {
    return cout << 0 << '\n', 0;
  }
  long long gas = n;
  long long location = 0;
  long long price;
  long long iter = 0;
  long long ans = 0;
  while (iter <= m) {
    location = x[iter].first;
    price = x[iter].second;
    long long nxt = iter + 1;
    bool okay = false;
    while (nxt <= m + 1 && x[nxt].first - location <= n) {
      if (price >= x[nxt].second) {
        long long dist = x[nxt].first - location;
        long long need = max(0ll, dist - gas);
        ans += price * need;
        gas += need;
        okay = true;
        break;
      }
      nxt++;
    }
    if (!okay) {
      long long need = n - gas;
      ans += price * need;
      gas += need;
    }
    iter++;
    gas -= x[iter].first - location;
    if (gas < 0) {
      return cout << -1, 0;
    }
  }
  cout << ans << '\n';
}
