class Solution(object):
def arrangeCoins(self, n):
"""
:type n: int
:rtype: int
"""
return int(2 ** 0.5 * (n + 1 / 8) ** 0.5 - 1 / 2)
if __name__ == '__main__':
solution = Solution()
print(solution.arrangeCoins(5))