If the third school had 200 students, and the second school had 40 more students than the third school, the second school had 200+40 = <<200+40=240>>240 students.
The third and second schools had 240+200 = <<240+200=440>>440 students on stage taking part in the debate.
Since the first school had twice as many students as the second school, and the second school had 240 students, the first school had 240*2= <<240*2=480>>480 students on stage taking part in the debate.
If after the debate was over, every student at the stage shook the mayor's hand, the number of students who shook the mayor's hand is 480+440 = <<480+440=920>>920 students
#### 920