#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;
}
const int N = 200100;
struct Input {
  int d, n, m;
  int x[N], p[N];
  bool read() {
    if (scanf("%d", &d) != 1) return 0;
    cin >> n >> m;
    for (int i = int(0); i < int(m); ++i) {
      scanf("%d%d", &x[i], &p[i]);
    }
    return 1;
  }
  void init(const Input& input) { *this = input; }
};
struct Data : Input {
  long long ans;
  bool ok;
  void write() {
    if (!ok) {
      cout << -1 << endl;
    } else
      cout << ans << endl;
  }
  virtual void solve() {}
  virtual void clear() { *this = Data(); }
};
struct Solution : Data {
  pair<int, int> a[N];
  stack<pair<int, int> > s;
  void solve() {
    x[m] = 0;
    p[m] = 0;
    m++;
    for (int i = int(0); i < int(m); ++i) {
      a[i] = make_pair(x[i], p[i]);
    }
    sort(a, a + m);
    reverse(a, a + m);
    ok = 1;
    for (int i = int(0); i < int(m); ++i) {
      int nw = ((i == 0) ? (d) : (a[i - 1].first)) - a[i].first;
      int can = n - nw;
      if (can < 0) {
        ok = 0;
        return;
      }
      while (!s.empty()) {
        auto it = s.top();
        if (it.first > a[i].second) {
          s.pop();
          pair<int, int> now = make_pair(a[i].second, min(can, it.second));
          if (now.second < it.second) {
            s.push(make_pair(it.first, it.second - now.second));
          }
          can -= now.second;
          if (can == 0) {
            break;
          }
        } else
          break;
      }
      s.push(make_pair(a[i].second, n - can));
    }
    ans = 0;
    while (!s.empty()) {
      auto it = s.top();
      ans += 1ll * it.first * it.second;
      s.pop();
    }
  }
  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;
}
