#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200100;
long long d, n, m;
pair<long long, long long> p[MAXN];
long long nxt[MAXN];
bool comp(pair<long long, long long> a, pair<long long, long long> b) {
  return a.first < b.first;
}
signed main() {
  memset(nxt, -1, sizeof nxt);
  cin >> d >> n >> m;
  p[0] = {0, 0};
  p[m + 1] = {d, 0};
  for (long long i = 1; i <= m; i++) cin >> p[i].first >> p[i].second;
  sort(p, p + m + 1, comp);
  deque<long long> fila;
  fila.push_back(m + 1);
  for (long long i = m; i >= 0; i--) {
    while (!fila.empty()) {
      long long at = fila.back();
      if (p[at].first - p[i].first > n) {
        fila.pop_back();
        continue;
      } else
        break;
    }
    while (!fila.empty()) {
      long long at = fila.front();
      if (p[at].second > p[i].second) {
        if (fila.size() == 1) nxt[i] = fila.front();
        fila.pop_front();
      } else
        break;
    }
    if (!fila.empty()) nxt[i] = fila.front();
    fila.push_front(i);
  }
  long long resp = 0;
  long long at = 0;
  long long tank = n;
  while (true) {
    if (at == m + 1) break;
    if (nxt[at] == -1) {
      cout << -1 << endl;
      return 0;
    }
    if (at == 0) {
      at = nxt[0];
      tank -= p[nxt[0]].first;
      continue;
    }
    long long b = nxt[at];
    if (p[b].second > p[at].second)
      resp += (n - tank) * p[at].second, tank = n - (p[b].first - p[at].first);
    else {
      long long h = p[b].first - p[at].first;
      if (tank < h)
        resp += (h - tank) * p[at].second, tank = 0;
      else
        tank -= h;
    }
    at = b;
  }
  cout << resp << endl;
}
