# EXAMPLES
# squared(5) would return 25
# squared("2") would return 4
# squared("tim") would return "timtimtim"

def squared(x):
    count = 0

    try:
      int(x)
      returnVal = x * x

    except TypeError:
        listX = list(x)
        for val in listX:
            count += 1
        returnVal = x * count
    except ValueError:
        listX = list(x)
        for val in listX:
            count += 1
        returnVal = x * count

    return returnVal