At a sale, Sundram saw a blue shirt was at 10% discount and a red shirt at 40% discount respectively. The discounted amount for both shirts are the same value. To buy both shirts, Sundram needed $4 more than what he had at first. If he bought the blue shirt only, he would have $13.40 left. How much was the discount given for the red shirt?

40%