Stability criterion and its calculation for sail-assisted ship