#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pci = pair<char, int>;
using vi = vector<int>;
using vll = vector<ll>;
using vpii = vector<pii>;
const ll infll = 1e18 + 3;
const int maxn = 1e6 + 77;
const int nmax = 1e6 + 77;
const ll basell = 1e18 + 3;
const int mod = 1e9 + 7;
const ld eps = 1e-7;
const int inf = 1009000999;
const int nv = 100505;
const int baseint = 1000200013;
const ld PI = acos(-1.0);
inline bool EQ(ld a, ld b) { return fabs(a - b) < 1e-9; }
pii t[4 * 200010];
pii query(int v, int vl, int vr, int l, int r) {
  if (r < vl || vr < l) return make_pair(inf, inf);
  if (l <= vl && vr <= r) return t[v];
  int vm = vl + (vr - vl) / 2;
  pii ql = query(2 * v + 1, vl, vm, l, r);
  pii qr = query(2 * v + 2, vm + 1, vr, l, r);
  return min(ql, qr);
}
void modify(int v, int vl, int vr, int pos, int val) {
  if (pos < vl || vr < pos) return;
  if (pos == vl && vl == vr) {
    t[v].first = val;
    t[v].second = -pos;
    return;
  }
  int vm = vl + (vr - vl) / 2;
  modify(2 * v + 1, vl, vm, pos, val);
  modify(2 * v + 2, vm + 1, vr, pos, val);
  t[v] = min(t[2 * v + 1], t[2 * v + 2]);
}
pii info[2 * nv];
int inline solve() {
  ios::sync_with_stdio(NULL), cin.tie(NULL), cout.tie(NULL);
  ;
  int d, n, m;
  cin >> d >> n >> m;
  int begin = 0;
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    info[i] = make_pair(a, b);
  }
  sort(info, info + m);
  info[m] = make_pair(d, 0);
  for (int i = 0; i < m; ++i) {
    modify(0, 0, m - 1, i, info[i].second);
  }
  int ti = n;
  int pos = 0;
  ll ans = 0;
  for (int end = 0; end <= m; ++end) {
    if (pos + ti >= d) break;
    if (pos + ti >= info[end].first) continue;
    if (end == begin) return cout << -1, 0;
    int need = info[end].first - pos - ti;
    while (need) {
      if (end == begin) return cout << -1, 0;
      pii otv = query(0, 0, m - 1, begin, end - 1);
      otv.second *= -1;
      begin = otv.second;
      ti -= info[begin].first - pos;
      pos = info[begin].first;
      int can = min(need, n - ti);
      need -= can;
      ti += can;
      ans += (ll)can * (ll)otv.first;
      if (need != 0) begin++;
    }
  }
  cout << ans;
  return 0;
}
int32_t main() {
  solve();
  return 0;
}
