If only a small, elite group planned and did the assassination (eg, rogue intelligence operatives, organised crime guys, or military people), the number of people with direct foreknowledge could be as low as 5 to 10.
This would include planners, shooters, and key facilitators who ensured security gaps, logistics, or cover-up efforts.
If multiple groups were involved (eg, intel agencies, mob connections, and political insiders), the number of people with some foreknowledge would increase to around 10 to 30.
This could include backchannel operatives, bribed officials, and key personnel ensuring media control or evidence manipulation.
This can be seen in someting like Operation Neptune Spear in 2011 when they killed bin Laden: known to only a small group of 5 to 10 high-ranking US officials, a few Navy SEALs, and CIA operatives before execution. Even White House was unaware.
CIA/Mafia plots against Castro involved a handful of CIA operatives and mob figures like Sam Giancana and Johnny Roselli, but information eventually leaked.
Iran/Contra... about 20 or 30.