Elements of finite mathematics