If I connected N numbers of amplifiers each have X gain 'dB" and Y power "dBm", how to calculate total gain and power?
The amplifier gain is the ratio of output power to input power. For example, a 20 dB power gain means that the output power will be 100 times the input power.

On the other hand, the power rating is the maximum output power the amplifier can handle. If that is 15 dBm, then the maximum output power is 32 mW (with a given distortion).

If you are connecting amplifiers in series, then the total gain (in dB) is the sum of all the individual gains. And you have to make sure that the signal level at the output of each amplifier does not exceed its power rating.