#include <bits/stdc++.h>
using namespace std;
long long d, n;
int m;
typedef struct {
  long long x, p;
} ta;
ta all[300000];
bool comp(ta& a, ta& b) { return a.x < b.x; }
int main() {
  cin >> d >> n >> m;
  for (int i = 0; i < m; ++i) {
    cin >> all[i].x >> all[i].p;
  }
  sort(all, all + m, comp);
  all[m].x = d;
  all[m].p = 0;
  m++;
  map<int, long long> cnt;
  map<int, long long>::iterator it;
  cnt[0] = n;
  long long count = n;
  long long x = 0;
  long long sum = 0;
  for (int i = 0; i < m; ++i) {
    long long dist = all[i].x - x;
    for (long long useDist = dist; useDist > 0;) {
      if (count <= 0) {
        cout << -1;
        return 0;
      }
      it = cnt.begin();
      if (it->second <= useDist) {
        useDist -= it->second;
        sum += it->first * it->second;
        count -= it->second;
        cnt.erase(it);
      } else {
        sum += it->first * useDist;
        it->second -= useDist;
        count -= useDist;
        useDist = 0;
      }
    }
    if (n - count > 0) {
      it = cnt.find(all[i].p);
      if (it == cnt.end()) {
        cnt.insert(make_pair(all[i].p, n - count));
      } else {
        it->second += n - count;
      }
      count = n;
    }
    for (; count > 0;) {
      it = cnt.end();
      it--;
      if (it->first <= all[i].p) break;
      long long countBad = it->second;
      cnt.erase(it);
      it = cnt.find(all[i].p);
      if (it == cnt.end()) {
        cnt.insert(make_pair(all[i].p, countBad));
      } else {
        it->second += countBad;
      }
    }
    x = all[i].x;
  }
  cout << sum;
  return 0;
}
