#include <bits/stdc++.h>
using namespace std;
struct station {
  int pos, cost;
  bool operator<(station const& o) const { return pos < o.pos; }
};
station pos[1000000];
int s[1000000];
int nextSmall[1000000];
int main() {
  int n, mgas, cgas, dist;
  scanf("%d %d %d", &dist, &mgas, &n);
  cgas = mgas;
  for (int i = 0; i < n; i++) {
    scanf("%d", &pos[i].pos);
    scanf("%d", &pos[i].cost);
  }
  sort(pos, pos + n);
  int stacklen = 0;
  for (int i = n - 1; i >= 0; i--) {
    while (stacklen > 0 && pos[s[stacklen - 1]].cost >= pos[i].cost) {
      stacklen--;
    }
    nextSmall[i] = (stacklen == 0 ? -1 : s[stacklen - 1]);
    s[stacklen] = i;
    stacklen++;
  }
  cgas -= pos[0].pos;
  long long cost = 0;
  for (int i = 0; i < n; i++) {
    if (cgas < 0) {
      printf("-1\n");
      return 0;
    }
    int gasNeeded = min(
        mgas, (nextSmall[i] == -1 ? dist : pos[nextSmall[i]].pos) - pos[i].pos);
    if (gasNeeded > cgas) {
      cost += (long long)(gasNeeded - cgas) * (long long)pos[i].cost;
      cgas = gasNeeded;
    }
    cgas -= (i == n - 1 ? dist : pos[i + 1].pos) - pos[i].pos;
  }
  if (cgas < 0) {
    printf("-1\n");
  } else {
    printf("%I64d\n", cost);
  }
}
