#include <bits/stdc++.h>
using namespace std;
int dp[200010];
int main() {
  int D, N, M;
  scanf("%d %d %d", &D, &N, &M);
  vector<pair<int, int> > v(M);
  for (int i = 0; i < M; i++) scanf("%d %d", &v[i].first, &v[i].second);
  sort(v.begin(), v.end());
  if (v.back().first != D) v.push_back(make_pair(D, 0));
  deque<int> q;
  int idx = 0, gas = N, loc = 0, last = -1;
  long long int cost = 0;
  while (idx < v.size()) {
    if (v[idx].first - loc <= gas) {
      while (!q.empty() && v[q.back()].second > v[idx].second) q.pop_back();
      q.push_back(idx);
      gas -= (v[idx].first - loc);
      dp[idx] = gas;
      loc = v[idx].first;
      idx += 1;
    } else {
      if (q.empty()) {
        cout << -1 << endl;
        return 0;
      }
      int pidx = q.front();
      if (last != -1) dp[pidx] = dp[last] - (v[pidx].first - v[last].first);
      int req = min(N - dp[pidx], v[idx].first - loc - gas);
      cost += (req) * ((long long)v[pidx].second);
      gas += req;
      dp[pidx] += req;
      if (dp[pidx] == N) q.pop_front();
      last = pidx;
    }
  }
  cout << cost << endl;
  return 0;
}
