#include <bits/stdc++.h>
using namespace std;
void read_file(bool outToFile = true) {}
struct station {
  int pos, price, idx;
  bool operator<(station oth) const { return pos < oth.pos; }
};
int d, cap, n;
station A[200000 + 2 + 9];
long long ans;
int prePro[200000 + 2 + 9];
pair<int, int> ST[3 * 200000 + 2 + 9 + 1 + 9];
int GS, GE;
void pre_process() {
  stack<station> stc;
  for (int i = n - 1; i >= 0; i--) {
    prePro[i] = -1;
    while (!stc.empty()) {
      station x = stc.top();
      if (x.pos > A[i].pos + cap) break;
      if (x.price <= A[i].price) {
        prePro[i] = x.idx;
        break;
      }
      stc.pop();
    }
    stc.push(A[i]);
  }
}
void init() {
  GS = 0, GE = n - 1;
  for (int i = 0; i < 3 * 200000 + 2 + 9 + 1 + 9; i++)
    ST[i] = make_pair((1000000000), (1000000000));
}
void insert(int idx, int val, int s = GS, int e = GE, int p = 1) {
  if (s == e) {
    ST[p] = make_pair(val, idx);
    return;
  }
  int m = s + e;
  m /= 2;
  if (idx <= m)
    insert(idx, val, s, m, 2 * p);
  else
    insert(idx, val, m + 1, e, 2 * p + 1);
  ST[p] = min(ST[2 * p], ST[2 * p + 1]);
}
void build_ST() {
  init();
  for (int i = 0; i < n; i++) insert(i, A[i].price);
}
pair<int, int> query(int fr, int to, int s = GS, int e = GE, int p = 1) {
  if (fr <= s && e <= to) return ST[p];
  if (fr > e || to < s) return make_pair((1000000000), (1000000000));
  int m = s + e;
  m /= 2;
  pair<int, int> ql = query(fr, to, s, m, 2 * p);
  pair<int, int> qr = query(fr, to, m + 1, e, 2 * p + 1);
  return min(ql, qr);
}
int query(int idx) {
  int lo = idx + 1, hi = n - 1 + 1;
  int right;
  while (lo != hi - 1) {
    int md = lo + hi;
    md /= 2;
    if (A[md].pos <= A[idx].pos + cap)
      lo = md;
    else
      hi = md;
  }
  int left = idx + 1;
  right = lo;
  if (A[right].pos > A[idx].pos + cap) return -1;
  pair<int, int> qry = query(left, right);
  return qry.second;
}
void solve() {
  ans = 0;
  int pos = 0;
  int fuel = cap;
  int price = 0;
  int idx = 0;
  while (pos != d) {
    int mn;
    mn = prePro[idx];
    if (mn != -1) {
      if (A[mn].pos - pos - fuel >= 0) {
        ans += 1LL * (A[mn].pos - pos - fuel) * price;
        pos = A[mn].pos;
        fuel = 0;
        price = A[mn].price;
        idx = mn;
      } else {
        fuel -= A[mn].pos - pos;
        pos = A[mn].pos;
        price = A[mn].price;
        idx = mn;
      }
      continue;
    }
    mn = query(idx);
    if (mn == -1) {
      ans = -1;
      return;
    }
    ans += 1LL * (cap - fuel) * price;
    fuel = cap;
    fuel -= A[mn].pos - pos;
    pos = A[mn].pos;
    price = A[mn].price;
    idx = mn;
  }
}
int main() {
  read_file();
  while (scanf("%d%d%d", &d, &cap, &n) != EOF) {
    n += 2;
    for (int i = 1; i <= n - 2; i++) scanf("%d%d", &A[i].pos, &A[i].price);
    A[0].pos = 0, A[0].price = 0;
    A[n - 1].pos = d, A[n - 1].price = 0;
    sort(A, A + n);
    for (int i = 0; i < n; i++) A[i].idx = i;
    pre_process();
    build_ST();
    solve();
    printf("%lld\n", ans);
  }
}
