#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
long long d, n, m, nxt[200005] = {0};
long long stk[200005] = {0}, top = 0;
long long ans = 0, add = 0, now;
struct node {
  long long x, p;
} a[200005];
bool cmp(node x, node y) { return x.x < y.x; }
int main() {
  scanf("%lld %lld %lld", &d, &n, &m);
  now = n;
  for (int i = 1; i <= m; i++) {
    scanf("%lld %lld", &a[i].x, &a[i].p);
  }
  a[0].x = 0;
  a[0].p = inf;
  a[m + 1].x = d;
  a[m + 1].p = 0;
  m++;
  sort(a, a + 1 + m, cmp);
  for (int i = m; i >= 0; i--) {
    while (top && a[i].p <= a[stk[top]].p) --top;
    if (!top)
      nxt[i] = -1;
    else
      nxt[i] = stk[top];
    stk[++top] = i;
  }
  for (int i = 0; i <= m; i++) {
    if (now < 0) {
      printf("-1\n");
      return 0;
    }
    if (nxt[i] == -1)
      add = d - a[i].x;
    else
      add = a[nxt[i]].x - a[i].x;
    if (add > n) add = n;
    if (add > now) {
      ans += (add - now) * 1LL * a[i].p;
      now = add;
    }
    now -= a[i + 1].x - a[i].x;
  }
  cout << ans << endl;
  return 0;
}
