You seem to be confused on a fundamental level about what a subnet is. See DanBig's comment. And Sirch's answer. And Kondybas' answer too.
I'll try to give you a bit more of a fundamental explanation about what you're doing wrong to even arrive at your question.
And since I don't like your examples (it doesn't make a whole lot of sense to use
18.104.22.168/30, and I don't think those are legal subnets either), I'm going to give my own.
First of all, 22.214.171.124/24 is NOT an IP address. It is a subnet. Therefore, do not treat it as an ip address, and just plug any number you feel like into the last octet. It designates the 24 bit subnet (class C subnet) begining at
126.96.36.199 As it's a full class C, it encompasses all 256 IPs starting with
123.123.123. So you could say it means "the subnet comprising all IP addresses between
When only dealing with class C subnets, the last octet of the IP may seem trivial, but it's not. Say you have a /27 subnet, for example. This would be a 32 host subnet, for anyone whose binary math is a bit rusty. If you were given a /27 subnet by your ISP, and had 32 externally facing IP addresses somewhere on
123.123.123, it might be useful to know the actual range you're allocated, not just that you have 32 IP addresses allocated somewhere in that range. Right? Well, that's where the last octet of the IP address makes a difference. It designates that you have however many available IP addresses, starting at that last octect.
188.8.131.52/27 would give you
184.108.40.206/27 would give you
220.127.116.11. And so on.
As previously mentioned, a much more in depth explanation is here.