program hi use, intrinsic :: iso_fortran_env implicit none integer(int32) :: n integer(int32), allocatable :: arr(:), cnts(:) integer(int32) :: i read(input_unit, *) n allocate(arr(n)) read(input_unit, *) arr(:) allocate(cnts(n), source = 0) do i = 1, n cnts(arr(i)) = cnts(arr(i)) + 1 end do block integer(int32) :: ans ans = 0 do i = 1, n ans = ans + cnts(i) / 2 end do write(output_unit, '(i0)') ans end block end program