Variable stars in Messier 3