#include <bits/stdc++.h>
using namespace std;
const int N = int(3e5), mod = int(1e9) + 7;
int n, d, m, x[N], p[N], r[N];
pair<int, int> q[N];
stack<int> st;
int main() {
  scanf("%d%d%d", &d, &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &q[i].first, &q[i].second);
  }
  q[++m] = make_pair(0, 0);
  q[++m] = make_pair(d, 0);
  sort(q + 1, q + m + 1);
  for (int i = 1; i <= m; i++) {
    x[i] = q[i].first;
    p[i] = q[i].second;
    if (i > 1 && x[i] - x[i - 1] > n) {
      puts("-1");
      return 0;
    }
  }
  for (int i = m; i > 0; i--) {
    while (!st.empty() && p[st.top()] > p[i]) st.pop();
    if (st.empty())
      r[i] = m;
    else
      r[i] = st.top();
    st.push(i);
  }
  long long ans = 0, cur = n;
  for (int i = 2; i <= m; i++) {
    cur -= x[i] - x[i - 1];
    int zp = max(min(n, x[r[i]] - x[i]) - cur, 0ll);
    ans += 1ll * zp * p[i];
    cur += zp;
  }
  printf("%lld", ans);
  return 0;
}
