Pošljite SMS: The mathematics of foam