Ответ:
import typing
from typing import Callable
def ReadSeqWhile(SeqType, predicate: Callable[[int], bool]):
temp = SeqType(input())
while predicate(temp):
yield temp
temp = SeqType(input())
def main():
RawSequence = ReadSeqWhile(int, lambda x: x != 0)
Selector = lambda item: (item % 3 == 0) and (item % 2 != 0)
FilteredSequence = filter(Selector, RawSequence)
print(f'Число элементов, удовлетворяющих условию: {len( list( FilteredSequence ) )}')
if __name__ == "__main__":
main()