ex 23.8, count characters with strchr()