#include <bits/stdc++.h>
using namespace std;
const int M = 200123;
const long long inf = (1LL << 61);
long long n, m, t, d;
vector<int> q;
pair<long long, long long> p[M];
long long r[M];
int fs[M];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> d >> t >> n;
  for (int i = 0; i < n; i++) {
    cin >> p[i].first >> p[i].second;
  }
  long long tank = t, res = 0;
  bool fail = false;
  p[n++] = {d, 0};
  sort(p, p + n);
  for (int i = n - 1; i >= 0; i--) {
    while (q.size() && p[q.back()].second > p[i].second) q.pop_back();
    fs[i] = (q.size() ? q.back() : -1);
    q.push_back(i);
  }
  for (int i = 0; i < n; i++) {
    tank -= (p[i].first - (i ? p[i - 1].first : 0));
    if (tank < 0) {
      fail = true;
    }
    if (i == n - 1) break;
    long long dst = (fs[i] < 0 ? inf : p[fs[i]].first - p[i].first);
    if (dst > t) {
      res += p[i].second * (t - tank);
      tank = t;
    } else {
      res += p[i].second * max(0LL, dst - tank);
      tank = max(dst, tank);
    }
  }
  if (fail)
    cout << -1 << endl;
  else {
    cout << res << endl;
  }
  return 0;
}
