Counter field based on another doctype documents count

Hi Dears,
I have a Doctype for drawings which has a field of dicipline of drawing, where the diciplines are are added throgh other doctype.
I need to add a counter for the drawings of a specifice decipline from the drawings doctype into the diciplines doctype counter field.
Could anyone help please in a code idea.
Your help will be much appreciated.