#include <bits/stdc++.h>
using namespace std;
long long d, n, m;
deque<pair<long long, long long> > dq;
pair<long long, long long> ohdear[1000001];
long long x[1000001], p[1000001];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> d >> n >> m;
  for (long long i = (1); i <= (m); i++)
    cin >> ohdear[i].first >> ohdear[i].second;
  sort(ohdear + 1, ohdear + 1 + m);
  for (long long i = (1); i <= (m); i++)
    x[i] = ohdear[i].first, p[i] = ohdear[i].second;
  m++;
  x[m] = d;
  dq.push_back({0, n});
  long long ans = 0;
  for (long long i = (1); i <= (m); i++) {
    long long dist = x[i] - x[i - 1];
    if (dist > n) {
      cout << -1;
      return 0;
    }
    long long remain = dist;
    while (remain) {
      pair<long long, long long> curr = dq.front();
      dq.pop_front();
      if (curr.second <= remain) {
        ans += curr.first * curr.second;
        remain -= curr.second;
      } else {
        ans += curr.first * remain;
        curr.second -= remain;
        remain = 0;
        dq.push_front(curr);
      }
    }
    long long currPrice = p[i];
    while (!dq.empty() && dq.back().first >= currPrice)
      dist += dq.back().second, dq.pop_back();
    dq.push_back({currPrice, dist});
  }
  cout << ans;
}
