#include <bits/stdc++.h>
const int N = (int)2e5 + 7;
const int block = 700;
const int inf = (int)1e9 + 7;
const int mod = (int)1e9 + 7;
const long long linf = (long long)3e18 + 7;
const int dx[] = {-1, 0, 1, 0, 1, -1, -1, 1};
const int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
using namespace std;
int n, m, d;
int nxt[N];
pair<int, int> a[N];
int main() {
  ios_base ::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> d >> n >> m;
  for (int i = (1); i <= (m); i++) {
    cin >> a[i].first >> a[i].second;
  }
  sort(a + 1, a + 1 + m);
  a[++m] = {d, 0};
  {
    stack<int> st;
    for (int i = (m); i >= (1); i--) {
      while ((int)st.size() && a[i].second < a[st.top()].second) st.pop();
      if ((int)st.size())
        nxt[i] = st.top();
      else
        nxt[i] = m;
      st.push(i);
    }
  }
  int cur = n;
  long long ans = 0;
  for (int i = (1); i <= (m); i++) {
    cur -= a[i].first - a[i - 1].first;
    if (cur < 0) cout << -1, exit(0);
    int need = min(n, a[nxt[i]].first - a[i].first);
    ans += (long long)max(0, need - cur) * a[i].second;
    cur = max(cur, need);
  }
  cout << ans;
  exit(0);
}
