#include <bits/stdc++.h>
using namespace std;
int D, N, M;
long long SOL;
int X[200100], P[200100], nextMin[200100];
stack<int> S;
vector<pair<int, int> > toOrder;
int main() {
  cin.tie(NULL);
  ios::sync_with_stdio(false);
  cin >> D >> N >> M;
  for (int i = 1; i <= M; i++) {
    cin >> X[i] >> P[i];
    toOrder.push_back(make_pair(X[i], P[i]));
  }
  sort(toOrder.begin(), toOrder.end());
  for (int i = 1; i <= M; i++) {
    X[i] = toOrder[i - 1].first;
    P[i] = toOrder[i - 1].second;
  }
  for (int i = 1; i <= M; i++) {
    while (S.size() && P[S.top()] > P[i]) {
      nextMin[S.top()] = i;
      S.pop();
    }
    S.push(i);
  }
  int fuel = N - X[1];
  if (fuel < 0) {
    cout << -1 << endl;
    return 0;
  }
  for (int i = 1; i <= M; i++) {
    if (i == M) {
      if (D - X[i] > N) {
        cout << -1 << endl;
        return 0;
      }
      SOL += max((long long)0, (long long)P[i] * (D - X[i] - fuel));
    } else {
      if (nextMin[i]) {
        if (X[nextMin[i]] - X[i] <= N) {
          SOL += max((long long)0,
                     (long long)P[i] * (X[nextMin[i]] - X[i] - fuel));
          fuel += max(0, X[nextMin[i]] - X[i] - fuel);
          fuel -= X[nextMin[i]] - X[i];
          i = nextMin[i] - 1;
          continue;
        }
      }
      if (D - X[i] <= N) {
        SOL += max((long long)0, (long long)P[i] * (D - X[i] - fuel));
        break;
      }
      SOL += max((long long)0, (long long)P[i] * (N - fuel));
      fuel = N;
      fuel -= (X[i + 1] - X[i]);
      if (fuel < 0) {
        cout << -1 << endl;
        return 0;
      }
    }
  }
  cout << SOL << endl;
  return 0;
}
