#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.1415926535897932384626433832795l;
template <typename T>
inline auto sqr(T x) -> decltype(x * x) {
  return x * x;
}
template <typename T1, typename T2>
inline bool umx(T1& a, T2 b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T1, typename T2>
inline bool umn(T1& a, T2 b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
struct Input {
  int d, n, m;
  vector<pair<int, int> > fuel;
  bool read() {
    if (scanf("%d%d%d", &d, &n, &m) != 3) return 0;
    fuel.resize(m);
    for (int i = int(0); i < int(m); ++i) {
      scanf("%d%d", &fuel[i].first, &fuel[i].second);
    }
    return 1;
  }
  void init(const Input& input) { *this = input; }
};
struct Data : Input {
  int64_t ans;
  void write() { printf("%" PRId64 "\n", ans); }
};
const int INF = 2000000000;
struct Solution : Data {
  vector<pair<int, int> > tree;
  int curk;
  void filter() {
    sort((fuel).begin(), (fuel).end());
    curk = 2;
    while (curk < ((int)(fuel).size())) curk *= 2;
    tree.assign(2 * curk, make_pair(INF, -1));
    for (int i = int(0); i < int(((int)(fuel).size())); ++i) {
      tree[curk + i] = make_pair(fuel[i].second, i);
    }
    for (int i = int(curk) - 1; i >= int(1); --i) {
      tree[i] = min(tree[i * 2], tree[i * 2 + 1]);
    }
  }
  int get_min(int l, int r) {
    l += curk, r += curk;
    pair<int, int> res = make_pair(INF, -1);
    while (l < r) {
      res = min(res, min(tree[l], tree[r]));
      l = (l + 1) / 2;
      r = (r - 1) / 2;
    }
    if (l == r) res = min(res, tree[l]);
    return res.second;
  }
  pair<int64_t, int> rec(int lid, int rid, int lx, int rx, int avail) {
    ;
    if (lid > rid) {
      return (rx - lx > avail) ? make_pair(-1ll, 0)
                               : make_pair(0ll, avail + lx - rx);
    }
    int mid = get_min(lid, rid);
    ;
    auto res = rec(lid, mid - 1, lx, fuel[mid].first, avail);
    int64_t sum = res.first;
    avail = res.second;
    if (res.first == -1ll) {
      return make_pair(-1ll, 0);
    }
    int want = max(min(rx - fuel[mid].first, n), avail);
    sum += 1ll * fuel[mid].second * (want - avail);
    res = rec(mid + 1, rid, fuel[mid].first, rx, want);
    if (res.first == -1ll) {
      return make_pair(-1ll, 0);
    }
    return make_pair(sum + res.first, res.second);
  }
  void solve() {
    filter();
    ans = rec(0, m - 1, 0, d, n).first;
  }
  void clear() {
    ;
    *this = Solution();
  }
};
Solution sol;
int main() {
  cout.setf(ios::showpoint | ios::fixed);
  cout.precision(20);
  sol.read();
  sol.solve();
  sol.write();
  return 0;
}
