#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
struct sss {
  int x, c;
} s[MAXN];
bool comp(const sss &a, const sss &b) { return a.x < b.x; }
int MIN[MAXN << 3];
void PushUPmin(int rt) { MIN[rt] = min(MIN[rt << 1], MIN[rt << 1 | 1]); }
void buildmin(int l, int r, int rt) {
  if (l == r) {
    MIN[rt] = s[l].c;
    return;
  }
  int m = (l + r) >> 1;
  buildmin(l, m, rt << 1);
  buildmin(m + 1, r, rt << 1 | 1);
  PushUPmin(rt);
}
int querymin(int L, int R, int l, int r, int rt) {
  if (L <= l && r <= R) {
    return MIN[rt];
  }
  int m = (l + r) >> 1;
  int ret = 999999999;
  if (L <= m) ret = min(ret, querymin(L, R, l, m, rt << 1));
  if (R > m) ret = min(ret, querymin(L, R, m + 1, r, rt << 1 | 1));
  return ret;
}
int main() {
  ios::sync_with_stdio(false);
  ;
  int m, n, i, j, k, d;
  scanf("%d%d%d", &d, &n, &m);
  for (i = 1; i <= m; i++) {
    scanf("%d%d", &s[i].x, &s[i].c);
  }
  s[0].x = 0, s[0].c = 0;
  m++;
  s[m].x = d, s[m].c = 0;
  sort(s, s + m, comp);
  for (i = 1; i <= m; i++) {
    if (s[i].x - s[i - 1].x > n) {
      cout << -1 << endl;
      return 0;
    }
  }
  long long ans = 0;
  int re = n;
  buildmin(1, m, 1);
  for (i = 1; i <= m; i++) {
    re -= (s[i].x - s[i - 1].x);
    int l = 1, r = m - i, t = 50, next = m;
    while (t--) {
      int mid = (l + r) >> 1;
      if (querymin(i + 1, i + mid, 1, m, 1) <= s[i].c)
        r = mid, next = min(next, i + mid);
      else
        l = mid;
    }
    int fill = min(n, (s[next].x - s[i].x));
    if (fill < re)
      continue;
    else {
      ans += (long long)(fill - re) * (long long)s[i].c;
      re = fill;
    }
  }
  cout << ans << endl;
}
