Krishna, Aditya, Agnishom, Sreejato, Satyen, Snehal and Sandeep (a total of 7) are going for a party. Before entering the disco hall, they decided to leave their jackets outside the hall. After enjoying themselves thoroughly, they went out to fetch their jackets and leave, but to their horrors, electricity went out, and everything was as dark as coal.

In a panic, they decided to randomly wear one jacket each. It so happens that at the most 4 of them got someone else's jacket. In how many ways can this happen?