#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > stations;
class mycomparison {
 public:
  bool operator()(const int& a, const int& b) const {
    return stations[a].second > stations[b].second;
  }
};
int main() {
  int d, n, m;
  cin >> d >> n >> m;
  stations.push_back({0, 0});
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    stations.push_back({a, b});
  }
  stations.push_back({d, 0});
  sort(stations.begin(), stations.end());
  int most_recent_fill = 0;
  int most_recent_fill_level = n;
  int level = n;
  int pos = 0;
  long long cost = 0;
  priority_queue<int, vector<int>, mycomparison> PQ;
  for (int i = 1; i <= m + 1; i++) {
    if (stations[i].first - pos > level) {
      pos += level;
      level = 0;
      while (pos < stations[i].first) {
        while (!PQ.empty() && PQ.top() < most_recent_fill) {
          PQ.pop();
        }
        if (PQ.empty()) {
          cout << "-1\n";
          return 0;
        } else {
          int station_fill_level = most_recent_fill_level +
                                   stations[most_recent_fill].first -
                                   stations[PQ.top()].first;
          most_recent_fill = PQ.top();
          if (n - station_fill_level >= stations[i].first - pos) {
            int fuel_bought = stations[i].first - pos;
            cost += ((long long)fuel_bought) * stations[PQ.top()].second;
            most_recent_fill_level = station_fill_level + fuel_bought;
            pos = stations[i].first;
            PQ.push(i);
          } else {
            int fuel_bought = n - station_fill_level;
            most_recent_fill_level = n;
            pos += fuel_bought;
            cost += ((long long)fuel_bought) * stations[PQ.top()].second;
            PQ.pop();
          }
        }
      }
    } else {
      level -= stations[i].first - pos;
      pos = stations[i].first;
      PQ.push(i);
    }
  }
  cout << cost << "\n";
}
