Fundamentals of accelerator mass spectrometry