scoreboard players remove @a[score_alive_min=1] alive 1
scoreboard players set @a[score_fly_min=1] alive 40
scoreboard players set @a[score_walk_min=1] alive 60

scoreboard players set @a fly 0
scoreboard players set @a walk 0

execute @a ~ ~ ~ scoreboard players operation @s block += @s a 
execute @a ~ ~ ~ scoreboard players operation @s block += @s b
execute @a ~ ~ ~ scoreboard players operation @s block += @s c 
execute @a ~ ~ ~ scoreboard players operation @s block += @s d 
execute @a ~ ~ ~ scoreboard players operation @s block += @s e 
execute @a ~ ~ ~ scoreboard players operation @s block += @s f 
execute @a ~ ~ ~ scoreboard players operation @s block += @s g 
execute @a ~ ~ ~ scoreboard players operation @s block += @s h 
execute @a ~ ~ ~ scoreboard players operation @s block += @s i 
execute @a ~ ~ ~ scoreboard players operation @s block += @s j 
execute @a ~ ~ ~ scoreboard players operation @s block += @s k 
execute @a ~ ~ ~ scoreboard players operation @s block += @s l 
execute @a ~ ~ ~ scoreboard players operation @s block += @s m 
execute @a ~ ~ ~ scoreboard players operation @s block += @s n
execute @a ~ ~ ~ scoreboard players operation @s block += @s o
execute @a ~ ~ ~ scoreboard players operation @s block += @s p 
execute @a ~ ~ ~ scoreboard players operation @s block += @s q 

scoreboard players set @a a 0
scoreboard players set @a b 0
scoreboard players set @a c 0
scoreboard players set @a d 0
scoreboard players set @a e 0
scoreboard players set @a f 0
scoreboard players set @a g 0
scoreboard players set @a h 0
scoreboard players set @a i 0
scoreboard players set @a j 0
scoreboard players set @a k 0
scoreboard players set @a l 0
scoreboard players set @a m 0
scoreboard players set @a n 0
scoreboard players set @a o 0
scoreboard players set @a p 0
scoreboard players set @a q 0

scoreboard players set @a[score_block_min=1] alive 20

scoreboard players set @a block 0

scoreboard players add @a[score_alive_min=1] total 1