#include <bits/stdc++.h>
using namespace std;
template <class T>
int getbit(T s, int i) {
  return (s >> i) & 1;
}
template <class T>
T onbit(T s, int i) {
  return s | (T(1) << i);
}
template <class T>
T offbit(T s, int i) {
  return s & (~(T(1) << i));
}
template <class T>
int cntbit(T s) {
  return __builtin_popcount(s);
}
template <class T>
T gcd(T a, T b) {
  T r;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
template <class T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
long long d, n, m;
multiset<pair<long long, long long> > S;
multiset<pair<long long, long long> >::iterator it;
pair<long long, long long> P[400005];
int r[400005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> d >> n >> m;
  for (int i = (1); i <= (m); ++i) {
    cin >> P[i].first >> P[i].second;
  }
  P[0] = make_pair(0, 0);
  sort(P + 1, P + m + 1);
  P[m + 1] = make_pair(d, 0);
  S.insert(make_pair(0, d));
  for (int i = m; i >= 1; i--) {
    r[i] = i;
    while (P[r[i] + 1].second > P[i].second) r[i] = r[r[i] + 1];
  }
  long long have = n, res = 0;
  bool ok = true;
  for (int i = (1); i <= (m + 1); ++i) {
    long long x = P[i].first - P[i - 1].first;
    if (x > n) {
      ok = false;
      break;
    }
    if (i != m + 1) {
      have -= x;
      long long need = min(n, P[r[i] + 1].first - P[i].first);
      if (have <= need) {
        res += (need - have) * P[i].second;
        have = need;
      }
    }
  }
  if (!ok)
    cout << -1 << endl;
  else
    cout << res << endl;
  return 0;
}
