#include <bits/stdc++.h>
typedef struct {
  unsigned long long position;
  unsigned long long price;
} GasStation;
int cmpFunc(const void* a, const void* b) {
  return ((GasStation*)a)->position - ((GasStation*)b)->position;
}
int main() {
  unsigned totalDistance;
  unsigned gasTankVolume;
  unsigned numOfGasStations;
  GasStation* stations;
  unsigned long long prevStopPosition;
  unsigned long long prevStopPrice;
  unsigned long long moneySpent;
  unsigned long long gasTankState;
  scanf("%u%u%u", &totalDistance, &gasTankVolume, &numOfGasStations);
  stations = (GasStation*)(calloc(numOfGasStations + 1, sizeof(GasStation)));
  for (unsigned i = 0; i < numOfGasStations; i++)
    scanf("%u%u", &stations[i].position, &stations[i].price);
  qsort(stations, numOfGasStations, sizeof(GasStation), cmpFunc);
  stations[numOfGasStations].position = totalDistance;
  stations[numOfGasStations].price = 0;
  prevStopPosition = 0;
  prevStopPrice = 0;
  moneySpent = 0;
  gasTankState = gasTankVolume;
  for (unsigned i = 0, cheapest; i <= numOfGasStations; i = cheapest + 1) {
    if (prevStopPosition + gasTankState < stations[i].position) {
      printf("-1");
      return 0;
    }
    for (cheapest = i++;
         i <= numOfGasStations &&
         stations[i].position <= prevStopPosition + gasTankState &&
         stations[cheapest].price >= prevStopPrice;
         i++) {
      if (stations[i].price < stations[cheapest].price) cheapest = i;
    }
    gasTankState -= stations[cheapest].position - prevStopPosition;
    if (stations[cheapest].price >= prevStopPrice)
      moneySpent += (gasTankVolume - gasTankState) * stations[cheapest].price;
    else {
      moneySpent -= gasTankState * prevStopPrice;
      moneySpent += gasTankVolume * stations[cheapest].price;
    }
    prevStopPosition = stations[cheapest].position;
    prevStopPrice = stations[cheapest].price;
    gasTankState = gasTankVolume;
  }
  printf("%I64d", moneySpent);
}
