Gravar-mail: New tolerance factor to predict the stability of perovskite oxides and halides