#include <bits/stdc++.h>
using namespace std;
int D, N, M;
vector<pair<int, int> > X;
stack<int> st;
vector<int> nxt;
int main() {
  scanf("%d %d %d", &D, &N, &M);
  X.resize(M);
  for (int i = 0; i < M; i++) {
    scanf("%d %d", &X[i].first, &X[i].second);
  }
  X.push_back(pair<int, int>(D, 0));
  sort(X.begin(), X.end());
  nxt = vector<int>(X.size(), -1);
  for (int i = X.size(); i--;) {
    while (!st.empty() && X[st.top()].second >= X[i].second) {
      st.pop();
    }
    if (!st.empty()) nxt[i] = st.top();
    st.push(i);
  }
  if (X[0].first > N) {
    printf("-1");
    return 0;
  }
  int pos = 0, F = N - X[pos].first;
  long long int cost = 0;
  while (1) {
    int tmp = nxt[pos];
    if (tmp == -1) break;
    if (X[tmp].first - X[pos].first > N) {
      if (X[pos + 1].first - X[pos].first > N) {
        printf("-1");
        return 0;
      }
      cost += (long long int)(N - F) * X[pos].second;
      F = N;
      pos++;
      F -= X[pos].first - X[pos - 1].first;
    } else {
      int p = X[tmp].first - X[pos].first;
      if (p <= F) {
        pos = tmp;
        F -= p;
      } else {
        cost += (long long int)(p - F) * X[pos].second;
        F = 0;
        pos = tmp;
      }
    }
  }
  printf("%I64d", cost);
}
