Group law on the neutral component of the Jacobian of a real curve of genus 2 having many real components \(E_8\) and the average size of the 3-Selmer group of the Jacobian of a pointed genus-2 curve 