Coordinating agents in a complex environment is a hard problem, but it can become even harder when certain characteristics of the tasks, like the required number of agents, are unknown. In those settings, agents not only have to coordinate themselves on the different tasks, but they also have to learn how many agents are required for each task. To achieve that, we have elaborated a selective perception reinforcement learning algorithm to enable agents to learn the required number of agents. Even though there were continuous variables in the task description, the agents were able to learn their expected reward according to the task description and the number of agents. The results, obtained in the RoboCupRescue, show an improvement in the agents overall performance. Categories and Subject Descriptors I.2.11 [Artificial Intelligence]: Distributed Artificial Intelligence--Coherence and Coordination, Intelligent Agents, Multiagent Systems; I.2.6 [Artificial Intelligence]: Learning General...