#include <bits/stdc++.h>
using namespace std;
struct seg_tree {
  long long seg[4 * 200009];
  pair<long long, long long> arr[200009];
  void construct_segtree(int start, int end, int pos) {
    if (end == start + 1)
      seg[pos] = start;
    else {
      int mid = (start + end) / 2;
      construct_segtree(start, mid, 2 * pos + 1);
      construct_segtree(mid, end, 2 * pos + 2);
      seg[pos] = arr[seg[2 * pos + 1]].first <= arr[seg[2 * pos + 2]].first
                     ? seg[2 * pos + 1]
                     : seg[2 * pos + 2];
    }
  }
  long long get_query(int ql, int qh, int low, int high, int pos) {
    if (qh <= low || ql >= high) return -1;
    if (low >= ql && high <= qh) return seg[pos];
    int mid = (low + high) / 2;
    long long v1 = get_query(ql, qh, low, mid, 2 * pos + 1);
    long long v2 = get_query(ql, qh, mid, high, 2 * pos + 2);
    if (v1 == -1)
      return v2;
    else if (v2 == -1)
      return v1;
    if (arr[v1].first <= arr[v2].first)
      return v1;
    else
      return v2;
  }
};
int comp(pair<long long, long long> x, pair<long long, long long> y);
long long get_nxt_best(long long x);
long long get_farrest(long long x);
long long fn();
seg_tree tree;
pair<long long, long long> arr[200009];
long long n, tank_size, last_point;
const long long inf = (1LL << 60);
int main() {
  scanf("%lld %lld %lld", &last_point, &tank_size, &n);
  for (int i = 0; i < n; i++) scanf("%lld %lld", &arr[i].second, &arr[i].first);
  sort(arr, arr + n, comp);
  for (int i = 0; i < n; i++) tree.arr[i] = arr[i];
  tree.construct_segtree(0, n, 0);
  long long ans = fn();
  printf("%lld\n", ans == inf ? -1 : ans);
  return 0;
}
long long fn() {
  long long ret = 0, curr_station = 0;
  long long feul = tank_size;
  if (arr[0].second > tank_size) return inf;
  curr_station = 0;
  feul -= arr[0].second;
  while (true) {
    int c1 = (curr_station == n - 1 &&
              last_point - arr[curr_station].second > tank_size);
    int c2 =
        (curr_station < n - 1 &&
         arr[curr_station + 1].second - arr[curr_station].second > tank_size);
    if (c1 + c2) return inf;
    long long nxt_best = get_nxt_best(curr_station);
    if (nxt_best == inf) {
      if (arr[curr_station].second + tank_size >= last_point) {
        long long dist = last_point - arr[curr_station].second;
        if (feul < dist) ret += (dist - feul) * arr[curr_station].first;
        break;
      }
      ret += (tank_size - feul) * arr[curr_station].first;
      feul = tank_size;
      long long farrest = get_farrest(curr_station);
      if (farrest == -1) return inf;
      long long to_go = tree.get_query(curr_station + 1, farrest + 1, 0, n, 0);
      if (to_go == -1) return inf;
      feul -= arr[to_go].second - arr[curr_station].second;
      curr_station = to_go;
    } else {
      if (arr[nxt_best].second >= last_point) {
        long long dist = last_point - arr[curr_station].second;
        if (feul < dist) ret += (dist - feul) * arr[curr_station].first;
        break;
      }
      long long dist = arr[nxt_best].second - arr[curr_station].second;
      if (dist > feul)
        ret += (dist - feul) * arr[curr_station].first, feul = dist;
      feul -= arr[nxt_best].second - arr[curr_station].second;
      curr_station = nxt_best;
    }
  }
  return ret;
}
long long get_nxt_best(long long x) {
  long long s = x + 1, b = n - 1, ret = inf;
  while (b >= s) {
    long long mid = (b + s) / 2;
    long long c1;
    if (x + 1 == mid + 1)
      c1 = mid + 1;
    else
      c1 = tree.get_query(x + 1, mid + 1, 0, n, 0);
    if (arr[c1].first <= arr[x].first)
      b = mid - 1, ret = min(ret, mid);
    else
      s = mid + 1;
  }
  if (ret != inf) {
    if (arr[ret].second - arr[x].second > tank_size) return inf;
  }
  return ret;
}
long long get_farrest(long long x) {
  long long s = x + 1, b = n - 1, ret = -1;
  while (b >= s) {
    long long mid = (b + s) / 2;
    if (arr[mid].second - arr[x].second <= tank_size) {
      ret = max(ret, mid);
      s = mid + 1;
    } else
      b = mid - 1;
  }
  return ret;
}
int comp(pair<long long, long long> x, pair<long long, long long> y) {
  return x.second < y.second;
}
