#include <bits/stdc++.h>
using namespace std;
inline void printInt(int a) { printf("%d", a); }
inline void printDbl(double a) { printf("%.10lf", a); }
inline int getInt() {
  int res;
  scanf("%d", &res);
  return res;
}
inline double getDbl() {
  double res;
  scanf("%lf", &res);
  return res;
}
const int maxn = 200100;
pair<int, int> vs[maxn];
int nextMin[maxn];
map<int, int> m;
int main() {
  srand(time(0));
  int d = getInt();
  int v = getInt();
  int n = getInt();
  for (int i = (0); i < (n); i++) {
    int pos = getInt(), price = getInt();
    vs[i] = make_pair(pos, price);
  }
  vs[n++] = make_pair(0, 0);
  vs[n++] = make_pair(d, 1000 * 1000 * 1000);
  sort(vs, vs + n);
  for (int i = (0); i < (n - 1); i++) {
    if (vs[i + 1].first - vs[i].first > v) {
      printf("-1");
      return 0;
    }
  }
  long long int res = 0;
  int fin = d;
  for (int i = n - 2; i >= 0; i--) {
    int pos = vs[i].first;
    while (fin > pos + v) {
      pair<int, int> minPair = *m.begin();
      int minPos = minPair.second;
      if (minPos >= fin) {
        m.erase(m.begin());
        continue;
      }
      int dif = min(fin - (pos + v), fin - minPos);
      res += (long long int)dif * minPair.first;
      fin -= dif;
    }
    m[vs[i].second] = pos;
  }
  cout << res;
  return 0;
}
