#include <bits/stdc++.h>
using namespace std;
long long n, m, d, nxt[200100], fuel, cost;
stack<pair<long long, long long> > st;
pair<long long, long long> a[200100];
int main() {
  scanf("%lld %lld %lld", &d, &n, &m);
  for (int i = 0; i < m; i++) scanf("%lld %lld", &a[i].first, &a[i].second);
  st.push(make_pair(m, -1e9));
  sort(a, a + m);
  a[m] = make_pair(d, -1e9);
  for (int i = m - 1; i >= 0; i--) {
    while (st.top().second > a[i].second) st.pop();
    nxt[i] = st.top().first;
    st.push(make_pair(i, a[i].second));
  }
  fuel = n;
  long long last = 0;
  for (int i = 0; i <= m; i++) {
    fuel -= a[i].first - last;
    last = a[i].first;
    if (fuel < 0) {
      cout << -1 << endl;
      return 0;
    }
    long long dist = a[nxt[i]].first - a[i].first;
    if (dist > n) {
      cost += (n - fuel) * a[i].second;
      fuel = n;
    } else {
      cost += max(0ll, dist - fuel) * a[i].second;
      fuel = max(fuel, dist);
    }
  }
  cout << cost << endl;
  return 0;
}
