#include <bits/stdc++.h>
using namespace std;
const int INF = 1000 * 1000 * 1000 + 10;
const int MAXN = 2 * 1000 * 1000;
int len;
pair<int, int> x[MAXN];
int mi[MAXN];
int get_mi(int tl, int tr, int v, int l, int r) {
  if (tl > tr) return INF;
  if (tl == l && tr == r) return mi[v];
  int s = (l + r) / 2;
  return min(get_mi(tl, min(s, tr), 2 * v, l, s),
             get_mi(max(s + 1, tl), tr, 2 * v + 1, s + 1, r));
}
int ne[MAXN];
vector<int> buf;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int d, n, m;
  cin >> d >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> x[i].first >> x[i].second;
  }
  x[m++] = make_pair(0, 0);
  x[m++] = make_pair(d, 0);
  sort(x, x + m);
  for (int i = m - 1; i >= 0; i--) {
    while (!buf.empty() && x[buf.back()].second >= x[i].second) {
      buf.pop_back();
    }
    if (buf.empty()) {
      ne[i] = -1;
    } else {
      ne[i] = buf.back();
    }
    buf.push_back(i);
  }
  for (len = 1; len <= m; len *= 2)
    ;
  for (int i = 0; i < m; i++) {
    mi[i + len] = x[i].second;
  }
  for (int i = len - 1; i > 0; i--) {
    mi[i] = min(mi[2 * i], mi[2 * i + 1]);
  }
  int cur = n;
  long long ans = 0;
  for (int i = 0; i < m - 1; i++) {
    auto it = lower_bound(x, x + m, make_pair(x[i].first + cur, INF));
    it--;
    int tl = i + 1, tr = (int)distance(x, it);
    int cur_mi = get_mi(tl + len, tr + len, 1, len, len * 2 - 1);
    if (cur_mi <= x[i].second) {
    } else {
      int need;
      if (ne[i] == -1) {
        need = n;
      } else {
        need = min(n, x[ne[i]].first - x[i].first);
      }
      ans += (long long)x[i].second * (need - cur);
      cur = need;
    }
    cur -= (x[i + 1].first - x[i].first);
    if (cur < 0) {
      cout << -1 << endl;
      return 0;
    }
  }
  cout << ans << endl;
  return 0;
}
