#include <bits/stdc++.h>
using namespace std;
int d, n, m;
pair<int, int> gas[200005];
int tb[20][200005];
int nxless[200005];
int query(int a, int b) {
  if (a == b) return m;
  int k = 31 - __builtin_clz(b - a);
  if (gas[tb[k][a]].second < gas[tb[k][b - (1 << k)]].second) return tb[k][a];
  return tb[k][b - (1 << k)];
}
int main() {
  scanf("%d %d %d", &d, &n, &m);
  for (int i = 0; i < m; i++) scanf("%d %d", &gas[i].first, &gas[i].second);
  gas[m++] = make_pair(d, 0);
  sort(gas, gas + m);
  for (int i = 0; i < m; i++) tb[0][i] = i;
  for (int k = 1; (1 << k) < m; k++) {
    for (int i = 0; i + (1 << k) <= m; i++) {
      if (gas[tb[k - 1][i]].second < gas[tb[k - 1][i + (1 << (k - 1))]].second)
        tb[k][i] = tb[k - 1][i];
      else
        tb[k][i] = tb[k - 1][i + (1 << (k - 1))];
    }
  }
  stack<int> st;
  for (int i = m - 1; i >= 0; i--) {
    while (!st.empty() && gas[st.top()].second > gas[i].second) st.pop();
    if (st.empty())
      nxless[i] = m;
    else
      nxless[i] = st.top();
    st.push(i);
  }
  long long cost = 0;
  int pos = 0, tank = n;
  if (tank >= d) {
    puts("0");
    return 0;
  }
  int l = lower_bound(gas, gas + m, make_pair(pos + 1, 0)) - gas;
  int r = lower_bound(gas, gas + m, make_pair(tank + 1, 0)) - gas;
  int idx = query(l, r);
  pos = gas[idx].first;
  tank -= pos;
  while (pos < d) {
    int maxpos = min(d, pos + n);
    int l = lower_bound(gas, gas + m, make_pair(pos + 1, 0)) - gas;
    int r = lower_bound(gas, gas + m, make_pair(maxpos + 1, 0)) - gas;
    int nxminp = query(l, r);
    if (gas[nxless[idx]].first <= maxpos) {
      int nxidx = nxless[idx];
      int add = max(0, gas[nxidx].first - (pos + tank));
      cost += (long long)add * gas[idx].second;
      tank += add;
      tank -= gas[nxidx].first - gas[idx].first;
      pos = gas[nxidx].first;
      idx = nxidx;
    } else if (nxminp < m) {
      int nxidx = nxminp;
      int add = max(0, gas[nxidx].first - (pos + tank));
      if (gas[nxidx].second > gas[idx].second) add = min(n - tank, d - pos);
      cost += (long long)add * gas[idx].second;
      tank += add;
      tank -= gas[nxidx].first - gas[idx].first;
      pos = gas[nxidx].first;
      idx = nxidx;
    } else {
      if (maxpos == d) {
        int add = max(0, d - (pos + tank));
        cost += (long long)add * gas[idx].second;
        tank += add;
        tank -= d - gas[idx].first;
        pos = d;
      } else {
        break;
      }
    }
  }
  cout << (pos == d ? cost : -1) << endl;
}
