#include <bits/stdc++.h>
using namespace std;
const long long int INF = (long long int)1e9 + 10;
const long long int INFLL = (long long int)1e18 + 10;
const long double EPS = 1e-12;
const long long int MOD = 1e9 + 7;
template <class T>
T &chmin(T &a, const T &b) {
  return a = min(a, b);
}
template <class T>
T &chmax(T &a, const T &b) {
  return a = max(a, b);
}
template <class T>
inline T sq(T a) {
  return a * a;
}
long long int in() {
  long long int x;
  scanf("%lld", &x);
  return x;
}
char yuyushiki[1000010];
string stin() {
  scanf("%s", yuyushiki);
  return yuyushiki;
}
long long int d, n, m;
priority_queue<pair<long long int, long long int>,
               vector<pair<long long int, long long int> >,
               greater<pair<long long int, long long int> > >
    que, mada;
int main() {
  d = in();
  n = in();
  m = in();
  for (long long int i = (0); i < (long long int)(m); i++) {
    long long int x = in();
    long long int p = in();
    mada.emplace(x, p);
  }
  long long int ans = 0;
  long long int cur = n;
  while (cur < d) {
    while (!mada.empty() && mada.top().first <= cur) {
      pair<long long int, long long int> w = mada.top();
      mada.pop();
      que.emplace(w.second, w.first);
    }
    long long int need = d - cur;
    if (!mada.empty()) {
      need = mada.top().first - cur;
    }
    if (((long long int)(que).size()) == 0) {
      puts("-1");
      return 0;
    }
    pair<long long int, long long int> w = que.top();
    long long int price = w.first;
    long long int can = n - (cur - w.second);
    long long int use = min(need, can);
    chmax(use, 0LL);
    if (use == 0) {
      que.pop();
    }
    ans += use * price;
    cur += use;
  }
  printf("%lld\n", ans);
  return 0;
}
