When he gave 40 seashells to his friends, Ali had 180-40= <<180-40=140>>140 seashells.
When he gave another 30 seashells to his brothers, he had 140-30 = <<140-30=110>>110 seashells
He also sold half of the seashells, a total of 1/2*110 = <<55=55>>55 seashells
He was left with 110-55= <<110-55=55>>55 seashells
#### 55