As long as you sell all of them you're definitely fine. I think you might still be fine if you bought them all at the same time, and only sold some of them, but I'm not as certain about that, and there wouldn't really be any reason to do this since you may as well take the full loss. What you need to avoid is anything that could be called a "replacement share" bought 30 days before/after the share(s) you sell.
secondcor521 is right the disallowed loss in a wash sale is added to the cost basis of the replacement shares, so if all transactions are in a taxable account then it's not terrible. The real problem is if you buy the replacement shares in a tax advantaged account because then you really do waste the loss deduction since cost basis doesn't matter in a tax advantaged account.