#include <bits/stdc++.h>
using namespace std;
struct nade {
  int x;
  long long p;
} a[200005];
bool cmp(nade x, nade y) { return x.x < y.x; }
int d, n, m, Next[200005], st[200005], top;
long long ans;
int main() {
  scanf("%d%d%d", &d, &n, &m);
  for (int i = 1; i <= m; i++) scanf("%d%lld", &a[i].x, &a[i].p);
  sort(a + 1, a + m + 1, cmp);
  a[m + 1].x = d;
  a[m + 1].p = 0;
  st[++top] = m + 1;
  for (int i = m; i >= 1; i--) {
    while (top && a[i].p < a[st[top]].p) top--;
    Next[i] = st[top];
    st[++top] = i;
  }
  int now = 0, sum = n;
  for (int i = 1; i <= m; i++) {
    if (a[i].x - now > sum) {
      puts("-1");
      return 0;
    }
    sum -= a[i].x - now;
    now = a[i].x;
    if (a[Next[i]].x - a[i].x <= n) {
      ans += a[i].p * (long long)max(0, a[Next[i]].x - a[i].x - sum);
      sum = max(sum, a[Next[i]].x - a[i].x);
      i = Next[i] - 1;
    } else {
      ans += a[i].p * (n - sum);
      sum = n;
    }
  }
  if (d - a[m].x > n) {
    puts("-1");
    return 0;
  }
  printf("%lld\n", ans);
}
