#include <bits/stdc++.h>
using namespace std;
pair<int, int> gas[200009];
int main() {
  int d, n, m;
  cin >> d >> n >> m;
  for (int i = 0; i < m; i++) cin >> gas[i].first >> gas[i].second;
  sort(gas, gas + m);
  int now = 0;
  set<pair<int, int> > que;
  long long int ans = 0;
  int look = 0;
  int tank = n;
  while (now < d) {
    if (now + tank >= d) {
      now += tank;
      break;
    }
    while (look < m && gas[look].first <= now + tank) {
      que.insert(pair<int, int>(gas[look].second, gas[look].first));
      look++;
    }
    while (que.size() && que.begin()->second <= now) que.erase(que.begin());
    if (que.size() == 0) break;
    pair<int, int> next = *que.begin();
    que.erase(que.begin());
    tank -= next.second - now;
    now = next.second;
    bool cheaper = false;
    while (look < m && gas[look].first <= now + n) {
      int dif = max(0, (gas[look].first - now) - tank);
      tank += dif;
      ans += dif * 1ll * next.first;
      que.insert(pair<int, int>(gas[look].second, gas[look].first));
      look++;
      if (gas[look - 1].second <= next.first) {
        cheaper = true;
        break;
      }
    }
    if (!cheaper) {
      int dif = min(n - tank, max(0, (d - now) - tank));
      ans += dif * 1ll * next.first;
      tank += dif;
    }
  }
  if (now < d)
    cout << -1 << '\n';
  else
    cout << ans << '\n';
}
