#include <bits/stdc++.h>
using namespace std;
long long n, m, d, pown = 1, xx[200005], p[200005], t[6000005], raod, l, r, ind,
                   ans, mid, g[200005];
stack<pair<long long, long long> > st;
pair<long long, long long> tt[200005];
int main() {
  cin >> d >> n >> m;
  d++;
  m++;
  tt[1].first = 1;
  for (int i = 2; i <= m; i++) {
    cin >> tt[i].first >> tt[i].second;
    tt[i].first++;
  }
  sort(tt + 1, tt + m + 1);
  for (int i = 1; i <= m; i++) {
    xx[i] = tt[i].first;
    p[i] = tt[i].second;
  }
  for (int i = m; i >= 1; i--) {
    while (st.size() && p[i] <= st.top().first) {
      st.pop();
    }
    if (!st.size())
      g[i] = -1;
    else
      g[i] = st.top().second;
    st.push({p[i], (long long)i});
  }
  xx[0] = 1;
  raod = 0;
  for (int i = 1; i <= m; i++) {
    raod -= xx[i] - xx[i - 1];
    if (raod < 0) {
      cout << -1;
      return 0;
    }
    if (g[i] == -1) {
      long long oo = raod;
      raod += min(d - xx[i] - raod, n - raod);
      ans += min(d - xx[i] - oo, n - oo) * p[i];
    } else {
      if (xx[g[i]] - xx[i] <= raod) continue;
      long long oo = raod;
      raod += min(xx[g[i]] - xx[i] - raod, n - raod);
      ans += min(xx[g[i]] - xx[i] - oo, n - oo) * p[i];
    }
  }
  if (xx[m] + raod < d) {
    cout << -1;
    return 0;
  }
  cout << ans;
  return 0;
}
