#include <bits/stdc++.h>
using namespace std;
const long long MAXN = (1 << 20);
long long n, m, d;
pair<long long, long long> a[MAXN];
void read() {
  cin >> d >> n >> m;
  for (long long i = 0; i < m; i++) cin >> a[i].first >> a[i].second;
}
struct state {
  long long cost, available;
  state() {
    cost = 0;
    available = 0;
  }
  state(long long _cost, long long _available) {
    cost = _cost;
    available = _available;
  }
};
void solve() {
  a[m++] = make_pair(d, 0);
  sort(a, a + m);
  long long inc = 0, answer = 0, pos = 0, curr_cap = n;
  deque<state> q;
  for (long long i = 0; i < m; i++) {
    while (!q.empty() && q.front().available - inc == 0) q.pop_front();
    if (a[i].first - pos <= curr_cap) {
      curr_cap -= (a[i].first - pos);
      pos = a[i].first;
    } else {
      while (!q.empty() && curr_cap < (a[i].first - pos)) {
        long long delta =
            min(a[i].first - pos - curr_cap, q.front().available - inc);
        curr_cap += delta;
        answer += delta * q.front().cost;
        inc += delta;
        if (q.front().available - inc == 0) q.pop_front();
      }
      if (q.empty() && curr_cap < (a[i].first - pos)) {
        cout << -1 << '\n';
        return;
      }
      curr_cap -= a[i].first - pos;
      pos = a[i].first;
    }
    while (!q.empty() && q.back().cost > a[i].second) q.pop_back();
    q.push_back(state(a[i].second, n - curr_cap + inc));
  }
  cout << answer << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  read();
  solve();
  return 0;
}
