#include <bits/stdc++.h>
using namespace std;
inline void pisz(int n) { printf("%d\n", n); }
template <typename T, typename TT>
ostream& operator<<(ostream& s, pair<T, TT> t) {
  return s << "(" << t.first << "," << t.second << ")";
}
template <typename T>
ostream& operator<<(ostream& s, vector<T> t) {
  for (int(i) = 0; (i) < (((int)((t).size()))); ++(i)) s << t[i] << " ";
  return s;
}
int main() {
  int(d), (n), (m);
  scanf("%d %d %d", &(d), &(n), &(m));
  ;
  vector<pair<long long, long long> > stations = {{0, 0}, {d, 0}};
  for (int(u) = 0; (u) < (m); ++(u)) {
    int(xi), (pi);
    scanf("%d %d", &(xi), &(pi));
    ;
    stations.push_back(make_pair(xi, pi));
  }
  sort(stations.begin(), stations.end());
  deque<pair<long long, long long> > q;
  long long sumfi = 0;
  long long cost = 0;
  for (int(i) = 0; (i) < (((int)((stations).size())) - 1); ++(i)) {
    long long price = stations[i].second;
    while (!q.empty() && q.back().second >= price) {
      sumfi -= q.back().first;
      q.pop_back();
    }
    q.push_back(make_pair(n - sumfi, price));
    sumfi = n;
    long long need = stations[i + 1].first - stations[i].first;
    while (need > 0 && !q.empty()) {
      long long buy = min(need, q.front().first);
      cost += buy * q.front().second;
      need -= buy;
      q.front().first -= buy;
      sumfi -= buy;
      if (q.front().first == 0) q.pop_front();
    }
    if (need > 0) {
      pisz(-1);
      return 0;
    }
  }
  cout << cost;
}
