#include <bits/stdc++.h>
using namespace std;
const int mx = 2e5 + 10;
pair<long long int, long long int> xp[mx];
long long int x[mx], p[mx];
int nxt[mx], a[mx], sz = 0;
int main() {
  int t, n;
  long long int d;
  scanf("%lld %d %d", &d, &t, &n);
  for (int i = 1; i <= n; i++) scanf("%lld %lld", &xp[i].first, &xp[i].second);
  sort(xp + 1, xp + n + 1);
  for (int i = 1; i <= n; i++) x[i] = xp[i].first, p[i] = xp[i].second;
  x[n + 1] = d;
  for (int i = 1; i <= n + 1; i++) {
    if (x[i] - x[i - 1] > t) {
      puts("-1");
      return 0;
    }
  }
  for (int i = n; i >= 0; i--) {
    while (sz != 0 && p[a[sz - 1]] > p[i]) sz--;
    nxt[i] = i;
    if (sz != 0) nxt[i] = a[sz - 1];
    a[sz++] = i;
  }
  long long int q = t, ans = 0;
  int pos = 0;
  while (true) {
    if (q >= d - x[pos]) break;
    int idx = nxt[pos];
    if (idx == pos) idx = n + 1;
    long long int rem = (x[idx] - x[pos]) - q;
    rem = max(rem, 0ll);
    rem = min(rem, t - q);
    q += rem;
    ans += rem * p[pos];
    q -= x[pos + 1] - x[pos];
    pos++;
  }
  printf("%lld\n", ans);
  return 0;
}
