Dynamically determine number of maps