Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
#Problem Name: Prime Number
#ID: tabris
#Mail: t123037@kaiyodai.ac.jp

while True:
    try:
        n = int(raw_input())
        List = []
        for i in range(1,n+1):
            List2 = []
            for j in range(2,i):
                List2.append(i % j != 0)
            if i != 1 and all(List2):
                List.append(i)
        print len(List)
    except:
        break

Fixed submission:
# coding: utf-8
#Problem Name: Prime Number
#ID: tabris
#Mail: t123037@kaiyodai.ac.jp

__max = 999999
List = [False,True]*(__max/2+1)
List[1] = False
List[2] = True
for i in xrange(3,int(__max**.5)+1,2):
    List[i**2::i] = [False]*len(List[i**2::i])

List = [i for i in xrange(2,__max) if List[i]]

while True:
    try:
        n = int(raw_input())
        print __import__('bisect',fromlist=['bisect_right']).bisect_right(List,n)
    except:
        break

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
#Problem Name: Prime Number
#ID: tabris
#Mail: t123037@kaiyodai.ac.jp

while True:
    try:
        n = int(raw_input())
        List = []
        for i in range(1,n+1):
            List2 = []
            for j in range(2,int(i**.5)+1):
                List2.append(i % j != 0)
            if i != 1 and all(List2):
                List.append(i)
        print len(List)
    except:
        break

Fixed submission:
# coding: utf-8
#Problem Name: Prime Number
#ID: tabris
#Mail: t123037@kaiyodai.ac.jp

__max = 999999
List = [False,True]*(__max/2+1)
List[1] = False
List[2] = True
for i in xrange(3,int(__max**.5)+1,2):
    List[i**2::i] = [False]*len(List[i**2::i])

List = [i for i in xrange(2,__max) if List[i]]

while True:
    try:
        n = int(raw_input())
        print __import__('bisect',fromlist=['bisect_right']).bisect_right(List,n)
    except:
        break

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
#Problem Name: Prime Number
#ID: tabris
#Mail: t123037@kaiyodai.ac.jp

while True:
    try:
        n = int(raw_input())
        count = 0
        for i in range(1,n+1):
            List = []
            for j in range(2,int(i**.5)+1):
                List.append(i % j != 0)
            if i != 1 and all(List):
                count += 1
        print count
    except:
        break

Fixed submission:
# coding: utf-8
#Problem Name: Prime Number
#ID: tabris
#Mail: t123037@kaiyodai.ac.jp

__max = 999999
List = [False,True]*(__max/2+1)
List[1] = False
List[2] = True
for i in xrange(3,int(__max**.5)+1,2):
    List[i**2::i] = [False]*len(List[i**2::i])

List = [i for i in xrange(2,__max) if List[i]]

while True:
    try:
        n = int(raw_input())
        print __import__('bisect',fromlist=['bisect_right']).bisect_right(List,n)
    except:
        break

Buggy python submission (verdict: Time Limit Exceeded):
while True:
    try:
        n = int(raw_input())
        count = 0
        for i in range(1,n+1):
            List = [i%j != 0 for j in range(3,int(i**.5)+1,2)]
            if i != 1 and all(List):
                count += 1
        print count
    except:
        break

Fixed submission:
# coding: utf-8
#Problem Name: Prime Number
#ID: tabris
#Mail: t123037@kaiyodai.ac.jp

__max = 999999
List = [False,True]*(__max/2+1)
List[1] = False
List[2] = True
for i in xrange(3,int(__max**.5)+1,2):
    List[i**2::i] = [False]*len(List[i**2::i])

List = [i for i in xrange(2,__max) if List[i]]

while True:
    try:
        n = int(raw_input())
        print __import__('bisect',fromlist=['bisect_right']).bisect_right(List,n)
    except:
        break