#include <bits/stdc++.h>
const int N = 2e5 + 5;
int dque[N];
std::pair<int, int> station[N];
int d, n, m;
int main() {
  scanf("%d%d%d", &d, &n, &m);
  for (int i = 0; i < m; ++i) {
    scanf("%d%d", &station[i].first, &station[i].second);
  }
  station[m++] = std::make_pair(0, 0);
  station[m++] = std::make_pair(d, 0);
  std::sort(station, station + m);
  for (int i = 0; i < m - 1; ++i) {
    if (station[i].first + n < station[i + 1].first) {
      puts("-1");
      return 0;
    }
  }
  int qs = 0, qe = 0, now = 0;
  long long ans = 0;
  for (int i = 0; i < m; ++i) {
    int x = station[i].first, p = station[i].second;
    while (qs < qe && station[dque[qs]].first + n < x) {
      ans +=
          1ll * (station[dque[qs]].first + n - now) * station[dque[qs]].second;
      now = station[dque[qs]].first + n;
      qs++;
    }
    ans += 1ll * (x - now) * station[dque[qs]].second;
    now = x;
    while (qs < qe && station[dque[qe - 1]].second > p) {
      qe--;
    }
    dque[qe++] = i;
  }
  std::cout << ans << '\n';
  return 0;
}
