On tuesday, 40 students visited the store and purchased felt tip pens. 27 students purchased blue ones and 20 students purchased red ones. how many students purchased both blue and red pens?