#include <bits/stdc++.h>
using namespace std;
vector<long long int> X, P;
vector<pair<long long int, long long int>> A;
struct cmp {
  bool operator()(const pair<long long int, long long int> A,
                  const pair<long long int, long long int> B) const {
    if (A.first == B.first)
      return A.second > B.second;
    else
      return A.first < B.first;
  }
};
int main(void) {
  long long int d, n, m;
  scanf("%lld%lld%lld", &d, &n, &m);
  m += 2;
  A.clear();
  A.resize(m);
  for (int i = 2; i < m; i++) scanf("%lld%lld", &A[i].first, &A[i].second);
  A[0] = {0, 0};
  A[1] = {d, LONG_MAX};
  sort(A.begin(), A.end());
  X.clear();
  X.resize(m);
  P.clear();
  P.resize(m);
  for (int i = 0; i < m; i++) {
    X[i] = A[i].first;
    P[i] = A[i].second;
  }
  long long int j = 0, loc = 0, cost = 0;
  set<pair<long long int, long long int>, cmp> cur;
  cur.insert({P[0], 0});
  for (int i = 1; i < int(X.size()); i++) {
    auto it = lower_bound(X.begin(), X.end(), X[i] - n);
    for (; j < int(it - X.begin()); j++) {
      if (*(cur.begin()) == make_pair(P[j], j) && loc < min(X[j] + n, d)) {
        cost += (min(X[j] + n, d) - loc) * P[j];
        loc = min(X[j] + n, d);
      }
      cur.erase({P[j], j});
    }
    if (loc < X[i]) {
      if (cur.empty()) {
        printf("-1\n");
        return 0;
      }
      cost += (cur.begin())->first * (X[i] - loc);
      loc = X[i];
    }
    cur.insert({P[i], i});
  }
  if (loc < d)
    printf("-1\n");
  else
    printf("%lld\n", cost);
}
