#include <bits/stdc++.h>
using namespace std;
const int inf = 10000000;
int D, N, M, L[200005];
pair<int, int> gas[200005];
int main() {
  scanf("%d", &D);
  scanf("%d%d", &N, &M);
  for (int i = 0; i < (M); i++) scanf("%d%d", &gas[i].first, &gas[i].second);
  gas[M].first = 0, gas[M].second = inf;
  gas[M + 1].first = D, gas[M + 1].second = 0;
  M += 2;
  sort(gas, gas + M);
  set<pair<int, int> > st;
  st.insert(make_pair(gas[M - 1].second, M - 1));
  L[M - 1] = -1;
  for (int i = M - 2; i >= 0; i--) {
    set<pair<int, int> >::iterator it =
        st.lower_bound(make_pair(gas[i].second, M));
    if (it == st.begin())
      L[i] = -1;
    else {
      it--;
      if (gas[it->second].first - gas[i].first > N)
        L[i] = -1;
      else
        L[i] = it->second;
    }
    while (st.size() > 0) {
      it = st.end();
      it--;
      if (it->first >= gas[i].second)
        st.erase(it);
      else
        break;
    }
    st.insert(make_pair(gas[i].second, i));
  }
  long long ans = 0, tank = N;
  int id = 0;
  while (id < M - 1) {
    if (L[id] == -1) {
      if (gas[id + 1].first - gas[id].first > N) break;
      ans += (N - tank) * gas[id].second;
      tank = N - gas[id + 1].first + gas[id].first;
      id++;
    } else {
      long long mi = max(gas[L[id]].first - gas[id].first - tank, 0LL);
      ans += mi * gas[id].second;
      tank = max(tank - gas[L[id]].first + gas[id].first, 0LL);
      id = L[id];
    }
  }
  if (id < M - 1)
    puts("-1");
  else
    printf("%I64d\n", ans);
  return 0;
}
