Mary had 18 baseball cards and promised to give Fred 26 baseball cards. If Mary buys 40 baseball cards, how many will she have left after she gives the promised cards to Fred?