A company has two types of machines, type R and type S. Operating at a constant rate,a machine of type R does a certain job in 36 hours and a machine of type S does the same job in 18 hours. If the company used the same number of each type of machine to do the job in 2 hours, how many machines of type R were used?