#include <bits/stdc++.h>
using namespace std;
int main() {
  int dest, capacity, n;
  scanf("%d%d%d", &dest, &capacity, &n);
  vector<pair<int, int>> stations;
  stations.emplace_back(0, INT_MAX);
  stations.emplace_back(dest, 0);
  for (int i = 0; i < n; i++) {
    int x, p;
    scanf("%d%d", &x, &p);
    stations.emplace_back(x, p);
  }
  sort(stations.begin(), stations.end());
  vector<long long> xs, ps;
  for (int i = 0; i < stations.size(); i++) {
    xs.push_back(stations[i].first);
    ps.push_back(stations[i].second);
  }
  long long ans = 0;
  long long remaining = capacity;
  multiset<pair<long long, int>> prices;
  int pos = 0;
  for (int reachind = 1; reachind < stations.size();) {
    if (xs[reachind] > xs[pos] + remaining) {
      if (xs[reachind] > xs[pos] + capacity) {
        ans += ps[pos] * (capacity - remaining);
        remaining = capacity;
        if (prices.empty()) {
          puts("-1");
          return 0;
        }
        int nextpos = prices.begin()->second;
        remaining -= xs[nextpos] - xs[pos];
        for (; pos < nextpos;) {
          pos++;
          prices.erase(make_pair(ps[pos], pos));
        }
        continue;
      }
      ans += ps[pos] * (xs[reachind] - xs[pos] - remaining);
      remaining = xs[reachind] - xs[pos];
    }
    prices.insert(make_pair(ps[reachind], reachind));
    reachind++;
    if (ps[pos] >= prices.begin()->first) {
      int nextpos = prices.begin()->second;
      remaining -= xs[nextpos] - xs[pos];
      for (; pos < nextpos;) {
        pos++;
        prices.erase(make_pair(ps[pos], pos));
      }
    }
  }
  printf("%lld\n", ans);
  return 0;
}
