#include <bits/stdc++.h>
using namespace std;
const int max_n = 200 * 1000 + 100;
long long dp[max_n];
int deq[max_n], t, h;
pair<long long, long long> a[max_n];
int main() {
  int d, n, m;
  cin >> d >> n >> m;
  for (int i = 0; i < m; i++) cin >> a[i].first >> a[i].second;
  a[m++] = {0, 0};
  a[m++] = {d, 0};
  sort(a, a + m);
  if (d == n) {
    cout << 0 << endl;
    return 0;
  }
  dp[0] = 0;
  deq[t++] = 0;
  for (int i = 1; i < m; i++) {
    if (a[i].first - a[i - 1].first > n) {
      cout << -1 << '\n';
      return 0;
    }
    while (t - h && (a[i].first - a[deq[h]].first) > n) h++;
    int p = deq[h];
    while (t - h && a[i].second <= a[deq[t - 1]].second) t--;
    if (t - h)
      dp[i] = dp[deq[t - 1]] + n * a[deq[t - 1]].second -
              a[i].second * (n - a[i].first + a[deq[t - 1]].first);
    else {
      dp[i] = dp[p] + (a[i].first - a[p].first) * a[p].second;
    }
    deq[t++] = i;
  }
  cout << dp[m - 1] << endl;
}
