#include <bits/stdc++.h>
using namespace std;
void Solve() {
  int i, j, k, n, m, d;
  scanf("%d%d%d", &(d), &(n), &(m));
  vector<pair<int, int> > mas;
  while (m--) {
    int x, p;
    scanf("%d%d", &(x), &(p));
    mas.push_back({x, p});
  }
  mas.push_back({d, 0});
  sort((mas).begin(), (mas).end());
  priority_queue<pair<int, int>, vector<pair<int, int> >,
                 greater<pair<int, int> > >
      q;
  int x = 0;
  long long price = 0;
  long long ans = 0;
  i = 0;
  int tank = n;
  while (x < d) {
    if (x + tank >= d) {
      x = d;
      break;
    }
    while (i < mas.size() && mas[i].first - x <= n) {
      int p = mas[i].second;
      q.push({mas[i].second, mas[i].first});
      i++;
      if (p < price) break;
    }
    while (q.size() && q.top().second <= x) q.pop();
    if (q.size() == 0) break;
    int pos = q.top().second;
    int p = q.top().first;
    q.pop();
    if (price <= p) {
      ans += (n - tank) * price;
      tank = n;
    } else {
      int diff = max(0, (pos - x) - tank);
      ans += diff * price;
      tank += diff;
    }
    price = p;
    tank -= pos - x;
    x = pos;
  }
  printf("%I64d", (x < d) ? -1 : ans);
}
int main() {
  Solve();
  return 0;
}
