If you have one sign at the beginning and one at the end, with a sign at every 500m. You need to know how many meters are in 3 km. Which is 3,000 meters, so that is 6 signs, with the addition of one at the beginning and one at the end is 8 signs in total.
Hope this helps!