I would like some help as well!
Here is my recent submission which timed out.
def main():
from sys import stdin
k = int(stdin.readline().split()[1])
print sum(1 for v in stdin.readlines() if int(v)%k==0)
main()
I tried it without readlines too (just stdin instead of stdin.readlines()). I'm not sure what to do because I tried a lot of different codes before this and none worked. Can anyone give hints? 
EDIT: I also tried the following way with map() to see if int() was my bottleneck. No luck 
def main():
from sys import stdin
k = int(stdin.readline().split()[1])
print sum(1 for v in map(int,stdin) if v%k==0)
main()
EDIT2: Instead of sum() I tried using len() since that's O(1) with a list comprehension whereas sum() is O(n). Still fail :\
def main():
from sys import stdin
k = int(stdin.readline().split()[1])
print len([1 for v in map(int,stdin) if v%k==0])
main()