#include <bits/stdc++.h>
using namespace std;
const int INF = int(1e9);
const double EPS = 1e-8;
struct debugger {
  template <typename T>
  debugger& operator,(const T& v) {
    cerr << v << " ";
    return *this;
  }
} dbg;
int d, n, m;
vector<pair<int, int> > arr;
vector<int> st;
int merge(int p1, int p2) {
  if (p1 == -1) return p2;
  if (p2 == -1) return p1;
  return (arr[p1].second <= arr[p2].second) ? p1 : p2;
}
void build(int p, int L, int R) {
  if (L == R)
    st[p] = L;
  else {
    int mid = (L + R) / 2;
    build(p * 2, L, mid);
    build(p * 2 + 1, mid + 1, R);
    st[p] = merge(st[p * 2], st[p * 2 + 1]);
  }
}
int query(int p, int L, int R, int i, int j) {
  if (i > R || j < L) return -1;
  if (i <= L && j >= R) return st[p];
  int mid = (L + R) / 2;
  int p1 = query(p * 2, L, mid, i, j);
  int p2 = query(p * 2 + 1, mid + 1, R, i, j);
  return merge(p1, p2);
}
bool flag;
long long solve(int L, int R, int fuel) {
  if (L == R) return 0;
  int lpos = arr[L].first, rpos = arr[R].first;
  if (L == R - 1) {
    if (rpos - lpos > n) {
      flag = false;
      return 0;
    }
    return (long long)max(0, (rpos - lpos - fuel)) * arr[L].second;
  }
  int mid = query(1, 0, m - 1, L, R - 1);
  int mpos = arr[mid].first, npos = arr[mid + 1].first, dist = npos - mpos;
  if (npos - mpos > n) {
    flag = false;
    return 0;
  }
  long long res = 0;
  int ex = 0;
  if (lpos + fuel >= mpos) {
    ex = fuel - (mpos - lpos);
  } else {
    res += solve(L, mid, fuel);
  }
  if (mpos + n >= rpos)
    res += (long long)(rpos - mpos - ex) * arr[mid].second;
  else
    res += (long long)(n - ex) * arr[mid].second + solve(mid + 1, R, n - dist);
  return res;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin >> d >> n >> m;
  arr.resize(m);
  for (int i = 0; i < m; i++) {
    cin >> arr[i].first >> arr[i].second;
  }
  arr.push_back({0, 0});
  arr.push_back({d, 0});
  m += 2;
  sort(arr.begin(), arr.end());
  st.resize(4 * m);
  build(1, 0, m - 1);
  flag = true;
  long long res = solve(0, m - 1, 0);
  if (!flag)
    cout << -1 << endl;
  else
    cout << res << endl;
  return 0;
}
