A company purchased $3,900 worth of merchandise. Transportation costs were an additional $340. The company returned $270 worth of merchandise and then paid the invoice within the 3% cash discount period. The total cost of this merchandise is:________