Brief review of thermodynamics. Topics include: Liouville theorem, Liouville equation, Poincare recurrences. The main postulate of statistical mechanics. Microcanonical and canonical ensembles. Grand canonical distribution and chemical equilibrium. Nonideal classical systems, van der Waals, and the liquid-gas transition. The quantum microcanonical, canonical, and grand canonical distributions. The density matrix: pure and mixed states; the quantum Liouville equation; the use of imaginary time. The quantum ideal gases: general formulae for any statistics. The ideal Fermi gas; examples of applications. The ideal Bose gas: Bose condensation and examples of applications.