#include <bits/stdc++.h>
using namespace std;
signed long long D, N;
int M;
pair<signed long long, signed long long> P[202020];
pair<int, int> Q[202020];
int nex[202020];
void solve() {
  int i, j, k, l, r, x, y;
  string s;
  cin >> D >> N >> M;
  for (i = 0; i < (M); i++) cin >> P[i].first >> P[i].second;
  P[M].first = P[M].second = 0;
  P[M + 1].first = D;
  P[M].second = 0;
  M += 2;
  sort(P, P + M);
  set<int> S;
  for (i = 0; i < (M); i++) Q[i] = {P[i].second, -i};
  sort(Q, Q + M);
  for (i = 0; i < (M); i++) {
    x = -Q[i].second;
    if (x < M - 1) nex[x] = *S.lower_bound(x);
    S.insert(x);
  }
  signed long long F = 0, ret = 0;
  for (i = 0; i < (M); i++) {
    if (i) {
      F -= P[i].first - P[i - 1].first;
      if (F < 0) return (void)printf("-1\n");
    }
    if (i == M - 1) break;
    signed long long d = min(N, P[nex[i]].first - P[i].first);
    if (F < d) {
      ret += (d - F) * P[i].second;
      F = d;
    }
  }
  cout << ret << endl;
}
int main(int argc, char** argv) {
  string s;
  int i;
  if (argc == 1) ios::sync_with_stdio(false);
  for (i = 0; i < (argc - 1); i++) s += argv[i + 1], s += '\n';
  for (i = 0; i < (s.size()); i++) ungetc(s[s.size() - 1 - i], stdin);
  solve();
  return 0;
}
