#include <bits/stdc++.h>
using namespace std;
struct Station {
  int x, p;
  bool operator<(const Station &r) const { return x < r.x; }
};
Station s[202000];
map<long long, long long> ss;
int main() {
  int D, N, M;
  while (cin >> D >> N >> M) {
    for (int i = int(1); i < int(M + 1); i++) cin >> s[i].x >> s[i].p;
    sort(s + 1, s + M + 1);
    s[M + 1] = Station{D, 0};
    long long ans = 0;
    ss.clear();
    ss.insert(pair<int, int>(0, N));
    for (int i = int(1); i < int(M + 2); i++) {
      long long sum = 0, d = s[i].x - s[i - 1].x;
      while (ss.size() && sum + ss.begin()->second < d) {
        sum += ss.begin()->second;
        ans += ss.begin()->first * ss.begin()->second;
        ss.erase(ss.begin());
      }
      if (!ss.size()) {
        ans = -1;
        break;
      }
      ss.begin()->second -= d - sum;
      ans += (d - sum) * ss.begin()->first;
      while (ss.size() && ss.rbegin()->first >= s[i].p) {
        d += ss.rbegin()->second;
        ss.erase(ss.rbegin()->first);
      }
      ss.insert(pair<int, int>(s[i].p, d));
    }
    cout << ans << endl;
  }
  return 0;
}
