Given a Python script containing functions, optimize the code to reduce the number of iterations.
def myfunc(n):
    for i in range(n):
        print(i) 

def main():
    myfunc(50)
    myfunc(100)
def myfunc(n):
   for i in range(0, n, 5): 
       print(i) 

def main(): 
   myfunc(50) 
   myfunc(100)