#include <bits/stdc++.h>
using namespace std;
using pii = pair<long long, long long>;
ostream& operator<<(ostream& os, const pii& seg) {
  return os << "[" << seg.first << ", " << seg.second << "]";
}
istream& operator>>(istream& is, pii& p) {
  is >> p.first >> p.second;
  return is;
}
int main() {
  ios_base::sync_with_stdio(0);
  int d, n, m;
  cin >> d >> n >> m;
  vector<pii> stations(m);
  for (auto& st : stations) cin >> st;
  sort(stations.begin(), stations.end());
  stations.push_back(make_pair(d, 1 << 30));
  long long prev = 0;
  size_t ptr = 0;
  deque<pii> Q;
  Q.push_front(make_pair(0, n));
  long long ans = 0;
  while (ptr < m + 1) {
    auto st = stations[ptr++];
    long long next = st.first, cost = st.second;
    long long dist = next - prev;
    if (dist > n) {
      cout << -1 << "\n";
      return 0;
    }
    long long fuel_used = 0;
    while (dist > 0) {
      auto fuel = Q.front();
      Q.pop_front();
      if (fuel.second <= dist) {
        fuel_used += fuel.second;
        ans += 1ll * fuel.first * fuel.second;
        dist -= fuel.second;
      } else {
        fuel_used += dist;
        ans += 1ll * fuel.first * dist;
        fuel.second -= dist;
        dist = 0;
        Q.push_front(fuel);
      }
    }
    prev = next;
    while (!Q.empty() && Q.back().first > cost) {
      fuel_used += Q.back().second;
      Q.pop_back();
    }
    Q.push_back(make_pair(cost, fuel_used));
  }
  cout << ans << "\n";
  return 0;
}
