#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1.01e9;
const double eps = 1e-9;
const int N = 1 << 18;
pair<int, int> t[2 * N];
inline pair<int, int> get(int l, int r) {
  l += N;
  r += N;
  pair<int, int> res = t[l];
  while (l <= r) {
    if (l & 1) res = min(res, t[l]);
    if (!(r & 1)) res = min(res, t[r]);
    l = (l + 1) >> 1;
    r = (r - 1) >> 1;
  }
  return res;
}
pair<int, int> e[N];
int ec = 0;
int total;
long long solve(int l, int r) {
  if (l == r) return 0;
  long long dist = e[r].first - e[l].first;
  if (l + 1 == r) {
    if (dist > total) {
      printf("-1\n");
      exit(0);
    }
    return dist * e[l].second;
  }
  if (dist <= total) return dist * e[l].second;
  int x = get(l + 1, r - 1).second;
  long long dist2 = e[x].first - e[l].first;
  if (dist2 > total) {
    return solve(l, x) + solve(x, r);
  } else {
    return solve(x, r) + dist2 * e[l].second +
           (total - dist2) * (e[l].second - e[x].second);
  }
}
int main() {
  int d, m;
  scanf("%d%d%d", &d, &total, &m);
  e[ec++] = make_pair(0, 0);
  e[ec++] = make_pair(d, 0);
  for (int i = 0; (i) < (m); ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    e[ec++] = make_pair(x, y);
  }
  sort(e, e + ec);
  for (int i = 0; (i) < (ec); ++i) t[i + N] = make_pair(e[i].second, i);
  for (int i = N - 1; i > 0; --i) t[i] = min(t[2 * i], t[2 * i + 1]);
  long long res = solve(0, ec - 1);
  printf("%I64d\n", res);
  return 0;
}
