If it is on a single partition, regardless of whether it is managed by an HMC, the simplest way is to use the command WRKSYSSTS. This command shows the memory and how it is allocated into pools for workload management. Add up the figures on the left hand side for you total memory.
If the system is managed by an HMC, or contains multiple partitions, then the approach is different.
If you aren’t authorised to the WRKSYSSTS command, you could try DSPSYSSTS. RAM is normally referred to as Main Storage. The value for total aux stg should give you the total amount of disk space available on the machine.