Function to count passive agents