#include <bits/stdc++.h>
int N, D, M;
std::pair<int, long long> ans[800001];
std::pair<int, int> A[200001];
int main() {
  scanf("%d%d%d", &D, &N, &M);
  for (int i = 0; i < M; i++) scanf("%d%d", &A[i].first, &A[i].second);
  std::sort(A, A + M);
  A[M] = {D, 0};
  if (A[0].first > N) {
    puts("-1");
    return 0;
  }
  for (int i = 0; i < M; i++)
    if (A[i + 1].first - A[i].first > N) {
      puts("-1");
      return 0;
    }
  int H = 400000, T = 400000;
  ans[H] = {N, 0};
  for (int i = 0; i <= M; i++) {
    while (H < T && ans[H + 1].first <= A[i].first) H++;
    if (ans[H].first < A[i].first)
      ans[H] = {A[i].first,
                ans[H].second + (ans[H + 1].second - ans[H].second) /
                                    (ans[H + 1].first - ans[H].first) *
                                    (A[i].first - ans[H].first)};
    while (H < T && (ans[T].second - ans[T - 1].second) /
                            (ans[T].first - ans[T - 1].first) >=
                        A[i].second)
      T--;
    ans[T + 1] = {A[i].first + N,
                  ans[T].second +
                      (long long)(A[i].first + N - ans[T].first) * A[i].second};
    T++;
  }
  printf("%lld\n", ans[H].second);
  return 0;
}
