#include <bits/stdc++.h>
using namespace std;
class segtree {
 public:
  int n;
  vector<long long> tree;
  segtree(int n) {
    this->n = n;
    tree.assign(4 * n, LLONG_MAX);
  }
  long long set(int t, long long x, int lt = 0, int rt = -1, int index = 0) {
    if (rt == -1) rt = n - 1;
    if (t < lt || t > rt) return tree[index];
    if (t == rt && t == lt) return tree[index] = min(x, tree[index]);
    int m = (lt + rt) / 2;
    return tree[index] = min(set(t, x, lt, m, index * 2 + 1),
                             set(t, x, m + 1, rt, index * 2 + 2));
  }
  int leftmostless(long long x, int lt = 0, int rt = -1, int index = 0) {
    if (rt == -1) rt = n - 1;
    if (tree[index] > x) return -1;
    if (lt == rt) return lt;
    int m = (lt + rt) / 2;
    int la = leftmostless(x, lt, m, index * 2 + 1);
    if (la != -1) return la;
    return leftmostless(x, m + 1, rt, index * 2 + 2);
  }
};
int main() {
  long long d, n;
  int m;
  scanf("%lld%lld%d", &d, &n, &m);
  vector<pair<long long, long long>> t(m + 2);
  t[0] = make_pair(0, 0);
  t[m + 1] = make_pair(d, 0);
  for (int i = 1; i <= m; i++) scanf("%lld%lld", &t[i].first, &t[i].second);
  sort(t.begin(), t.end());
  segtree S(m + 2);
  vector<int> closest(m + 2);
  for (int i = m + 1; i >= 0; i--) {
    closest[i] = S.leftmostless(t[i].second);
    S.set(i, t[i].second);
  }
  int pos = 0;
  long long cost = 0, can = n;
  while (pos != m + 1) {
    int c = closest[pos];
    if (c == -1 || t[c].first - t[pos].first > n) c = pos + 1;
    if (t[c].first - t[pos].first > n) {
      printf("-1");
      return 0;
    }
    long long newcan;
    if (t[c].second <= t[pos].second)
      newcan = max(can, t[c].first - t[pos].first);
    else
      newcan = n;
    cost += t[pos].second * (newcan - can);
    can = newcan - (t[c].first - t[pos].first);
    pos = c;
  }
  printf("%lld", cost);
  return 0;
}
