Telefona gönder: The hidden mathematical logic of stories