40 people - 7 people = <<40-7=33>>33 people are wearing stripes.
The number of people wearing horizontal stripes is 4 horizontal stripes/checkered shirt x 7 checkered shirts = <<4*7=28>>28 horizontal stripes
The number of people wearing vertical stripes is 33 total stripes - 28 horizontal stripes = <<33-28=5>>5 vertical stripes
#### 5