#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void umax(T &a, T b) {
  if (a < b) a = b;
}
template <class T>
inline void umin(T &a, T b) {
  if (a > b) a = b;
}
template <class T>
inline T abs(T a) {
  return a > 0 ? a : -a;
}
template <class T>
inline T gcd(T a, T b) {
  return __gcd(a, b);
}
template <class T>
inline T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
long long modpow(long long a, long long n, long long temp) {
  long long res = 1, y = a;
  while (n > 0) {
    if (n & 1) res = (res * y) % temp;
    y = (y * y) % temp;
    n /= 2;
  }
  return res % temp;
}
long long ison(long long mask, long long pos) { return (mask & (1 << pos)); }
long long cbit(long long n) {
  long long k = 0;
  while (n) n &= (n - 1), k++;
  return k;
}
long long nbit(long long n) {
  long long k = 0;
  while (n) n /= 2, k++;
  return k;
}
long long mod = 1e9 + 7;
int sgn(long long x) { return x < 0 ? -1 : !!x; }
long long xo(long long i) {
  if ((i & 3) == 0) return i;
  if ((i & 3) == 1) return 1;
  if ((i & 3) == 2) return i + 1;
  return 0;
}
const long long N = 1 << 18;
pair<long long, long long> t[2 * N];
inline pair<long long, long long> get(long long l, long long r) {
  l += N;
  r += N;
  pair<long long, long long> 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<long long, long long> e[N];
long long ec = 0;
long long tot;
long long solve(long long l, long long r) {
  if (l == r) return 0;
  long long dist = e[r].first - e[l].first;
  if (l + 1 == r) {
    if (dist > tot) {
      cout << -1;
      exit(0);
    }
  }
  if (dist <= tot) return dist * e[l].second;
  long long x = get(l + 1, r - 1).second;
  long long dist2 = e[x].first - e[l].first;
  if (dist2 > tot) {
    return solve(l, x) + solve(x, r);
  } else {
    return solve(x, r) + dist2 * e[l].second +
           (tot - dist2) * (e[l].second - e[x].second);
  }
}
int main() {
  long long d, m;
  cin >> d >> tot >> m;
  e[ec++] = make_pair(0, 0);
  e[ec++] = make_pair(d, 0);
  for (long long i = 0; i < m; ++i) {
    long long x, y;
    cin >> x >> y;
    e[ec++] = make_pair(x, y);
  }
  sort(e, e + ec);
  for (long long i = 0; i < ec; ++i) t[i + N] = make_pair(e[i].second, i);
  for (long long i = N - 1; i > 0; i--) {
    t[i] = min(t[2 * i], t[2 * i + 1]);
  }
  long long res = solve(0, ec - 1);
  cout << res;
}
