#include <bits/stdc++.h>
using namespace std;
void solve(long long len) {
  long long cap;
  int n;
  cin >> cap >> n;
  vector<pair<int, int>> stat(n);
  for (int i = 0; i < n; i++) cin >> stat[i].first >> stat[i].second;
  stat.push_back(make_pair(0, 0));
  stat.push_back(make_pair(len, 0));
  sort((stat).begin(), (stat).end());
  n = (int)(stat).size();
  bool ok = true;
  for (int i = 1; i < n; i++) ok &= (stat[i].first - stat[i - 1].first <= cap);
  if (!ok) {
    cout << -1 << endl;
    return;
  }
  long long cost = 0;
  deque<pair<int, int>> current;
  long long total = 0;
  for (int i = 0; i < n; i++) {
    const int price = stat[i].second;
    while (!current.empty() && current.back().first > price) {
      cost += (long long)(current.back().second) *
              (long long)(-current.back().first),
          total -= (long long)current.back().second, current.pop_back();
    }
    current.push_back(make_pair(price, cap - total));
    cost += (long long)(cap - total) * (long long)price;
    total = cap;
    if (i + 1 != n) {
      int rem_dist = stat[i + 1].first - stat[i].first;
      total -= rem_dist;
      while (rem_dist > 0) {
        assert(!current.empty());
        if (current.front().second > rem_dist)
          current.front().second -= rem_dist, rem_dist = 0;
        else {
          rem_dist -= current.front().second;
          current.pop_front();
        }
      }
    }
  }
  cout << cost << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  while (cin >> n) solve(n);
}
