#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
inline istream& operator>>(istream& fin, pair<T1, T2>& pr) {
  fin >> pr.first >> pr.second;
  return fin;
}
template <class T0, class T1, class T2>
inline istream& operator>>(istream& fin, tuple<T0, T1, T2>& t) {
  fin >> get<0>(t) >> get<1>(t) >> get<2>(t);
  return fin;
}
template <class T>
inline istream& operator>>(istream& fin, vector<T>& a) {
  for (auto& u : a) fin >> u;
  return fin;
}
template <class T, size_t n>
inline istream& operator>>(istream& fin, array<T, n>& a) {
  for (auto& u : a) fin >> u;
  return fin;
}
template <class FwdIter>
inline auto dump(FwdIter first, FwdIter last, const char* dlm) -> void {
  copy(first, last,
       ostream_iterator<typename iterator_traits<FwdIter>::value_type>(cout,
                                                                       dlm));
}
int64_t probD() {
  int64_t dist, cap;
  size_t n;
  cin >> dist >> cap >> n;
  vector<pair<int64_t, int64_t>> gas(n);
  cin >> gas;
  sort(begin(gas), end(gas));
  if (cap < gas.front().first || cap + gas.back().first < dist) return -1;
  for (size_t i = 1; i < n; ++i)
    if (cap + gas[i - 1].first < gas[i].first) return -1;
  reverse(begin(gas), end(gas));
  gas.push_back({0, 0});
  int64_t pos = dist;
  vector<pair<int64_t, int64_t>> price;
  int64_t cost = 0;
  ;
  for (size_t i = 0; i < gas.size(); ++i) {
    const auto ipos = gas[i].first;
    const auto iprice = gas[i].second;
    int64_t val = pos - ipos;
    while (!price.empty() && val < cap) {
      auto& pr = price.back();
      if (pr.first < 1 + iprice)
        break;
      else {
        const auto inc = min(cap - val, pr.second);
        val += inc;
        cost -= inc * pr.first;
        ;
        if (inc < pr.second)
          pr.second -= inc;
        else
          price.pop_back();
      }
    }
    price.push_back({iprice, val});
    cost += val * iprice;
    pos = ipos;
    ;
  }
  return cost;
}
int main(const int argc, char* argv[]) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << probD();
  return EXIT_SUCCESS;
}
