Why is this language over {a,b,c} regular? The language of all words over the alphabet {a,b,c} such that 


the number of as in the word 
minus the number of cs in the word 


is divisible by three. 

How is this language regular? Lecturer notes says that it is, and then provides no explanation at all. 
I tried drawing a DFA for it, but it just seems that the longer the word, the more states there will be and there could be an infinite amount, which is not allowed? 
Please help, thanks.
All you need to keep track of is the value "number of $a$s seen minus number of $c$s seen", modulo&nbsp;3 &ndash; call that $X$. There are only three different values that $X$ can take. When you see the next character of the input, it's either $a$, $b$ or&nbsp;$c$. Think about how each one affects&nbsp;$X$ and you should be very close to a 3-state automaton that accepts the language you're interested in.