scoreboard players set two func.temp 2 $data modify storage func:temp half.result set from storage func:temp $(list) execute store result score length func.temp run data get storage func:temp half.result scoreboard players operation half func.temp = length func.temp scoreboard players operation half func.temp /= two func.temp scoreboard players operation odd func.temp = length func.temp scoreboard players operation odd func.temp %= two func.temp scoreboard players operation half func.temp += odd func.temp function func:half/f1