#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T maxm(T& a, T b) {
  return a = a < b ? b : a;
}
template <class T>
inline T minm(T& a, T b) {
  return a = a > b ? b : a;
}
const int MAX = 5e5 + 1;
pair<long long, long long> sta[MAX];
int M;
long long d, N;
long long nearCheap[MAX];
int main() {
  cin >> d >> N >> M;
  for (int i = 0; i < M; i++) {
    cin >> sta[i].first >> sta[i].second;
  }
  sort(sta, sta + M);
  stack<int> S;
  memset(nearCheap, -1, sizeof(nearCheap));
  for (int i = M - 1; i >= 0; i--) {
    while (!S.empty() && sta[S.top()].second >= sta[i].second) S.pop();
    if (!S.empty()) nearCheap[i] = S.top();
    S.push(i);
  }
  long long ans = 0;
  long long cur = N - sta[0].first;
  sta[M].first = d;
  for (int i = 0; i < M; i++) {
    if (cur < 0) {
      cout << -1 << '\n';
      return 0;
    }
    long long x = sta[i].first;
    long long nearC = nearCheap[i] >= 0 ? sta[nearCheap[i]].first : d;
    if (nearC - x > N) {
      ans += (sta[i].second) * (N - cur);
      cur = N;
    } else if (nearC - x > cur) {
      ans += sta[i].second * (nearC - x - cur);
      cur = nearC - x;
    }
    cur -= sta[i + 1].first - sta[i].first;
    if (cur < 0) {
      cout << -1 << '\n';
      return 0;
    }
  }
  cout << ans << '\n';
  return 0;
}
