#include <bits/stdc++.h>
using namespace std;
struct bung {
  int x;
  int c;
} o[200021];
bool cmp(bung a, bung b) { return a.x < b.x; }
list<int> li;
list<int> con;
int main() {
  int i;
  int now;
  int d, n, m;
  int st, ed, mid;
  int k, p;
  int tmp;
  long long ans = 0;
  scanf("%d %d %d", &d, &n, &m);
  k = 1;
  while (k < m + 3) k <<= 1;
  for (i = 1; i <= m; i++) scanf("%d %d", &o[i].x, &o[i].c);
  o[m + 1].x = d;
  o[m + 2].x = 0x7fffffff;
  sort(o + 1, o + m + 1, cmp);
  now = 0;
  int can;
  int hr, ck;
  li.push_back(0);
  for (i = 1; i <= m + 1; i++) {
    ck = o[now].x;
    while (li.size()) {
      tmp = li.front();
      can = o[tmp].x + n;
      if (can >= o[i].x) {
        hr = o[i].x - ck;
        ans += (long long)hr * o[tmp].c;
        break;
      } else {
        if (can > ck) {
          ans += (long long)(can - ck) * o[tmp].c;
          ck = can;
        }
        li.pop_front();
      }
    }
    if (li.size() == 0) {
      printf("-1");
      return 0;
    }
    now = i;
    while (li.size()) {
      tmp = li.back();
      if (o[tmp].c >= o[now].c)
        li.pop_back();
      else
        break;
    }
    li.push_back(now);
  }
  printf("%I64d\n", ans);
  return 0;
}
