#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 58;
const int N = 200007;
int d, B, n;
int x[N], p[N];
struct segTree {
  int T[4 * N], pos[4 * N];
  void build(int v, int tl, int tr) {
    if (tl == tr) {
      pos[v] = tl;
      T[v] = p[tl];
      return;
    }
    int tm = (tl + tr) / 2;
    build(2 * v, tl, tm);
    build(2 * v + 1, tm + 1, tr);
    if (T[2 * v] <= T[2 * v + 1]) {
      T[v] = T[2 * v];
      pos[v] = pos[2 * v];
    } else {
      T[v] = T[2 * v + 1];
      pos[v] = pos[2 * v + 1];
    }
  }
  pair<int, int> get_min(int v, int tl, int tr, int l, int r) {
    if (tl == l && tr == r) return make_pair(T[v], pos[v]);
    int tm = (tl + tr) / 2;
    if (r <= tm) return get_min(2 * v, tl, tm, l, r);
    if (l > tm) return get_min(2 * v + 1, tm + 1, tr, l, r);
    auto p1 = get_min(2 * v, tl, tm, l, tm);
    auto p2 = get_min(2 * v + 1, tm + 1, tr, tm + 1, r);
    return min(p1, p2);
  }
} tree;
void solve() {
  scanf("%d%d%d", &d, &B, &n);
  vector<pair<int, int> > mas;
  for (int i = 1; i <= n; ++i) {
    int x, p;
    scanf("%d%d", &x, &p);
    mas.push_back(make_pair(x, p));
  }
  sort((mas).begin(), (mas).end());
  for (int i = 1; i <= n; ++i) {
    x[i] = mas[i - 1].first;
    p[i] = mas[i - 1].second;
  }
  ++n;
  x[n] = d;
  tree.build(1, 0, n);
  long long ans = 0;
  int cur = 0;
  for (int i = 0; i < n; ++i) {
    int l = 0, r = B - cur;
    while (l < r) {
      int m = (l + r) / 2;
      int right = x[i] + cur + m;
      int ptr = upper_bound(x, x + n + 1, right) - x - 1;
      if (ptr == i) {
        l = m + 1;
        continue;
      }
      auto res = tree.get_min(1, 0, n, i + 1, ptr);
      if (res.first >= p[i])
        l = m + 1;
      else
        r = m;
    }
    ans += (long long)l * p[i];
    cur += l;
    cur -= (x[i + 1] - x[i]);
    if (cur < 0) {
      puts("-1");
      return;
    }
  }
  cout << ans << endl;
}
void testgen() {
  FILE* f = fopen("input.txt", "w");
  srand(time(0));
  fclose(f);
}
int main(int argc, char* argv[]) {
  solve();
  return 0;
}
