#include <bits/stdc++.h>
using namespace std;
pair<long long, long long> gas[200010];
long long d, n, m;
int min_ran(int a, int b) {
  long long min_n = 1999999999;
  int pos = a;
  for (int i = a; i <= b; i++) {
    if (min_n > gas[i].second) {
      min_n = gas[i].second;
      pos = i;
    }
  }
  return pos;
}
int tree[200010 * 4];
int init_tree(int ll, int rr, int pos) {
  if ((rr - ll) == 0) {
    return tree[pos] = rr;
  }
  int mid = (ll + rr) / 2;
  int left_p = init_tree(ll, mid, pos * 2);
  int right_p = init_tree(mid + 1, rr, (pos * 2) + 1);
  if (gas[left_p].second < gas[right_p].second) {
    return tree[pos] = left_p;
  } else {
    return tree[pos] = right_p;
  }
}
int query(int ll, int rr, int pos, int t_l, int t_r) {
  if ((ll >= t_l) && (rr <= t_r)) {
    return tree[pos];
  } else if ((ll > t_r) || (rr < t_l)) {
    return 0;
  } else {
    int mid = (ll + rr) / 2;
    int left_p = query(ll, mid, pos * 2, t_l, t_r);
    int right_p = query(mid + 1, rr, (pos * 2) + 1, t_l, t_r);
    if (left_p == 0) {
      return right_p;
    }
    if (right_p == 0) {
      return left_p;
    }
    if (gas[left_p].second < gas[right_p].second) {
      return left_p;
    } else {
      return right_p;
    }
  }
}
int main() {
  std::ios_base::sync_with_stdio(false);
  ;
  cin >> d >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> gas[i].first >> gas[i].second;
  }
  if (d <= n) {
    cout << 0;
    return 0;
  }
  sort(gas + 1, gas + m + 1);
  if (gas[1].first > n) {
    cout << -1;
    return 0;
  }
  init_tree(1, m, 1);
  long long cover = n;
  int le = 1;
  int ri = 2;
  long long ans = 0;
  bool is_val = 1;
  for (; (ri <= m) || (le <= m);) {
    if ((ri <= m) && (gas[ri].first <= (gas[le].first + n))) {
      if (gas[ri].second <= gas[le].second) {
        if (gas[ri].first <= cover) {
        } else {
          ans += (gas[ri].first - cover) * gas[le].second;
          cover = gas[ri].first;
        }
        le = ri;
      }
      ri++;
      continue;
    }
    if (le == ri - 1) {
      if ((d <= (gas[le].first + n))) {
        if (d <= cover) {
        } else {
          ans += (d - cover) * gas[le].second;
        }
      } else {
        is_val = 0;
      }
      break;
    }
    if ((gas[le].first + n) <= cover) {
    } else if ((gas[le].first + n) <= d) {
      ans += ((gas[le].first + n) - cover) * gas[le].second;
      cover = (gas[le].first + n);
    } else {
      ans += (d - cover) * gas[le].second;
      cover = d;
    }
    int tmp = query(1, m, 1, le + 1, ri - 1);
    le = tmp;
  }
  if (is_val) {
    cout << ans << "\n";
  } else {
    cout << -1;
  }
  return 0;
}
