Merge "InputDispatcher: Optimize count()"