#include <bits/stdc++.h>
using namespace std;
const int maxn = 200100;
pair<int, int> a[maxn];
int b[maxn];
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 >> a[i].first >> a[i].second;
  sort(a, a + m);
  stack<int> st;
  for (int i = m - 1; i >= 0; --i) {
    while (!st.empty() && a[st.top()].second > a[i].second) st.pop();
    if (st.empty())
      b[i] = d;
    else
      b[i] = a[st.top()].first;
    st.push(i);
  }
  int cur = n - a[0].first;
  a[m].first = d;
  long long ans = 0;
  for (int i = 0; i < m; ++i) {
    if (cur < 0) {
      cout << -1 << endl;
      return 0;
    }
    int c = b[i] - a[i].first;
    if (c > cur) {
      ans += (long long)a[i].second * (min(n, c) - cur);
      cur = min(n, c);
    }
    cur -= a[i + 1].first - a[i].first;
  }
  if (cur < 0)
    cout << -1 << endl;
  else
    cout << ans << endl;
  return 0;
}
