#include <bits/stdc++.h>
using namespace std;
pair<int, int> P[200020];
int tr[524288], inx;
void build(int t, int l, int r) {
  if (l == r) {
    tr[t] = P[l].second;
    return;
  }
  build(2 * t, l, (l + r) / 2);
  build(2 * t + 1, (l + r) / 2 + 1, r);
  tr[t] = min(tr[2 * t], tr[2 * t + 1]);
}
void gofin(int t, int l, int r, int I, int les) {
  if (inx != -1) return;
  if (tr[t] >= les) return;
  if (r < I) return;
  if (I <= l) {
    if (l == r) {
      inx = l;
      return;
    }
    if (tr[2 * t] < les)
      gofin(2 * t, l, (l + r) / 2, I, les);
    else
      gofin(2 * t + 1, (l + r) / 2 + 1, r, I, les);
    return;
  }
  gofin(2 * t, l, (l + r) / 2, I, les);
  gofin(2 * t + 1, (l + r) / 2 + 1, r, I, les);
}
int d, n, m, i;
int Fill[200200];
long long ans;
int main() {
  cin >> d >> n >> m;
  for (i = 1; i <= m; i++) scanf("%d%d", &P[i].first, &P[i].second);
  m++;
  P[m].first = d;
  P[m].second = 0;
  sort(P + 1, P + m + 1);
  build(1, 1, m);
  for (i = 1; i < m; i++) {
    inx = -1;
    gofin(1, 1, m, i, P[i].second);
    Fill[i] = min(n, P[inx].first - P[i].first);
  }
  int now = n;
  for (i = 1; i <= m; i++) {
    if (now < P[i].first - P[i - 1].first) {
      cout << -1 << endl;
      return 0;
    }
    now -= P[i].first - P[i - 1].first;
    if (now >= Fill[i]) continue;
    ans += 1LL * (Fill[i] - now) * P[i].second;
    now = Fill[i];
  }
  cout << ans << endl;
}
