Storage capacities of two-layered networks