#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 10;
long long d, n, m;
struct Node {
  long long pos, val, id;
} a[N];
long long top = 0;
Node sta[N];
Node Min[N];
bool mycmp(Node x, Node y) { return x.pos < y.pos; }
signed main() {
  scanf("%lld %lld %lld", &d, &m, &n);
  for (long long i = 1; i <= n; i++) scanf("%lld %lld", &a[i].pos, &a[i].val);
  sort(a + 1, a + n + 1, mycmp);
  a[++n] = (Node){d, 0};
  for (long long i = 1; i <= n; i++) a[i].id = i;
  sta[++top] = a[n];
  for (long long i = n - 1; i; i--) {
    while (a[i].val < sta[top].val && top) top--;
    Min[i] = sta[top];
    sta[++top] = a[i];
  }
  for (long long i = 1; i <= n; i++)
    if (a[i].pos - a[i - 1].pos > m) {
      cout << -1;
      return 0;
    }
  long long nowd = m, now;
  nowd -= a[1].pos;
  now = 1;
  long long ans = 0;
  while (now < n) {
    long long id = Min[now].id, po = a[id].pos;
    if (po - a[now].pos > m) {
      now++;
      ans += (m - nowd) * a[now - 1].val;
      nowd = m;
      nowd -= (a[now].pos - a[now - 1].pos);
      continue;
    }
    if (nowd >= po - a[now].pos) {
      nowd -= (po - a[now].pos);
      now = id;
      continue;
    }
    long long Need = po - a[now].pos;
    ans += (Need - nowd) * a[now].val;
    now = id;
    nowd = 0;
  }
  printf("%lld", ans);
}
