How can I get training data size and validation data size of each class?

With DataBlock.dataloaders.n and DataBlock.dataloaders.valid.n I can get the training data size and validation data size. But I want to get the data size of each class accordingly (I have 2 classes) in the datasets for training the model. Such as:

Training data
of class 1: 600
of class 2: 560

Test
of class 1: 200
of class 2: 230

Does anyone know how I can get this information? Thanks!!