[Question]
  [
You are the roughest, toughest, coolest cowboy west of the Mississippi. However, some weird guy on a wacky nerd website decided that it would be cool to plop you into random unfinished landscapes and fight. No matter, you'll still win. However, to help you win those grueling gunfights you'll write home about, it's helpful to know how many bullets the coward lurking in the landscape has.
How about you help this poor guy out. Given an ASCII landscape, find the gun inside it and tell him how many bullets are loaded into it. This is the gun:
```
  (X)
(X\ /X)
 (XVX)
  \X/
```
Each `X` in the above picture is a potential slot for a bullet. The slot will either contain a space or one of `0,O,o` (may not be consistent - the cowboy may have loaded different types of bullets in his gun).
There will always be exactly one gun, matching the above description, in the landscape. However, please note that the spaces around and inside the gun can contain anything.
# Input
You will be given a string containing printable ASCII (so not tabs) and newlines to separate lines. You may also take a list of strings, if you wish. Strings will all be padded with spaces, so they will all be the same length. The input will be at least 4 rows high and 7 columns wide.
There will always be exactly one gun in the landscape.
# Output
You will output how many bullets (`0, O, o`) there are in the gun, so your output will always between `0` and `6`.
# Test Cases
```
  (0)   ( )
(o\ /o( \ / )
 (oVo) ( V )
  \o/   \ /
0
----------------------------
////////////////////////////
////////////////////////////
/////////////(o)////////////
///////////(0\// )//////////
////////////( Vo)///////////
/////////////\ /////////////
////////////////////////////
----------------------------
3
()()()()()()()()()()()()()()()()\)/)()()()()()()()()()()()()
()()()()()()()()()()()()()()()()(V)()()()()()()()()()()()()(
()()()()()()()(\0/)()()()()()()()()()()()()()()()()()()()()(
()()()()()()()()()()()()()()()()()()()()()()()( )()()()()()(
()()()()()()(o)()()()()()()()(00)()()()()()(( \(/0)()()()()(
()()()()()()()()()()()()()()()()()()()()()()(( V )()()()()()
()()()()()()()()()()()()()()()()()()()()()()()\O/()()()()()(
2
------(0)---
||||(0\|/0)
-----(0V0)--
||||||\0/
-------_------
|||||||-|
------|-|
|||||||-|
------|-|
6
00ooOO(0)/\\/V
  ( )
( \\/ )
 ( V )
 \\ /
00OOoo()()()())))
0
  (\)     (0)
(0\\/0) ( \0/ )
 (0V0)   ( V )
 \\0/     \ /
1 (left gun is invalid because of the `\` in the bullet slot)
-00(0)00\0
-(O\0/o)\ 
- (OVo)o\0
-o \ /oo/ 
5
```
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so shortest answer in bytes wins.
  
[Answer]
# [Snails](https://github.com/feresum/PMA), 71 bytes
[Try it online.](https://tio.run/##NYmhDsMwDAV5vsJjNomtcoN9wVjQU6S2aNKUgaoaSPPt2Qx27O6Otj5fx5z3BF0dsnxQvAMneOwO3UJ28DLOW@e2XfnKLYvXt9eHV6s0@r@OSnMSMYQCNklsgJoQE0xJ0i8Wi81UQhE5AOkX "Snails – Try It Online")
```
A
\/a=\)2w\V={\\u\(}c=\/b={\\c\(2}u!{(nb|.|.n.)=^o=^O=^0^ }{nb|.|.n.}^ 
```
[Answer]
# Mathematica, 170 bytes
```
Catch@BlockMap[b="O"|"o"|"0";MatchQ[#,p=Characters@{"  (X)  ","(X\\ /X)"," (XVX) ","  \\X/  "}/." "->_/."X"->$;p/.$->b|"X"|" "]&&Throw@Count[Pick[#,p,$],b,2]&,#,{4,7},1]&
```
Takes an array of strings/chars. Returns the number of bullets.
[Answer]
# JavaScript, ~~215~~ ~~211~~ 209 bytes
Thanks to Shaggy for -4 bytes!
```
f=
i=>[...i].map((_,x)=>eval(String.raw`a=i.match(/(\n|^).{${x}}..\(${Z='([oO0 ])'}\).*\n.{${x}}\(${Z}\\.\/${Z}\).*\n.{${x}}.\(${Z}V${Z}\).*\n.{${x}}..\\${Z}\//);a&&alert(a.filter(i=>/^[oO0]$/.test(i)).length)`))
tests = [["  (0)   ( )\n(o\\ /o( \\ / )\n (oVo) ( V )\n  \\o/   \\ /",0],["----------------------------\n////////////////////////////\n////////////////////////////\n/////////////(o)////////////\n///////////(0\\// )//////////\n////////////( Vo)///////////\n/////////////\\ /////////////\n////////////////////////////\n----------------------------",3],["()()()()()()()()()()()()()()()()\\)/)()()()()()()()()()()()()\n()()()()()()()()()()()()()()()()(V)()()()()()()()()()()()()(\n()()()()()()()(\\0/)()()()()()()()()()()()()()()()()()()()()(\n()()()()()()()()()()()()()()()()()()()()()()()( )()()()()()(\n()()()()()()(o)()()()()()()()(00)()()()()()(( \\(/0)()()()()(\n()()()()()()()()()()()()()()()()()()()()()()(( V )()()()()()\n()()()()()()()()()()()()()()()()()()()()()()()\\O/()()()()()(",2],["------(0)---\n||||(0\\|/0)\n-----(0V0)--\n||||||\\0/\n-------_------\n|||||||-|\n------|-|\n|||||||-|\n------|-|",6],["00ooOO(0)/\\\\/V\n\n  ( )\n( \\\\/ )\n ( V )\n \\\\ /\n\n00OOoo()()()())))",0],["  (\\)     (0)\n(0\\\\/0) ( \\0/ )\n (0V0)   ( V )\n \\\\0/     \\ /",1]]
alert = x => i = x;
tests.forEach((t, index) => {
    i = 'Not Found'
    f(t[0]);
    document.getElementById('a').textContent += t[0] + '\n\n' + i + '\n\n';
    if (i != t[1]) {
        document.getElementById('a').textContent += 'Failed test ' + index + '! Expected '  + t[1] + '\n\n';
        document.getElementById('a').style = 'color: red'
    }
})
```
```
<pre id="a"></pre>
```
Basically, tries to match a gun `n` characters after a line break, for `n` from `0` to the length of the string.
[Answer]
# Python 2, ~~219~~ ~~224~~ 227 bytes
```
import re
f=lambda s:sum(sum(g>' 'for g in m.groups())for m in[re.match(r'.*@..\(X\)..@\(X\\./X\)@.\(XVX\).@..\\X/.*'.replace('X','([0Oo ])').replace('@',r'[^\n]*\n.{%d}'%i),'\n'+s,re.DOTALL)for i in range(0,s.find('\n'))]if m)
```
EDIT: Fixed a bug which cost me 5 bytes :(... found 3 bytes of extra `r''`s that weren't needed. And then Grrr!! Was not counting `\` chars in my code correctly, so added 6...
Takes a string with newlines; retuns the number of bullets found.
Basically, applies a regex that looks for the gun pattern with 0, 1, ... lineLength characters of pad at the beginning of the lines.
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 357 351 bytes
```
#define M(F,C)F(i){i=s[i]==C;}
b,i;char*s,c;M(L,'(')M(R,')')M(A,'/')M(D,'\\')M(V,'V')B(i){i=b=(c=s[i])==32?b:c==111?b+1:c==79?b+1:c==48?b+1:0;}(*t[])(int)={L,B,R,L,B,D,A,B,R,L,B,V,B,R,D,B,A};main(j,v,k,l)char**v;{for(s=v[1];s[l++]!=10;);for(;k=i,s[i++];){for(j=17;j--;)if(!(t[j])(k-=j==13?l-3:j==8?l-5:j==5?2:j==2?l-4:1))break;b=j<0?putchar(b+47):1;}}
```
[Try it online! (golfed)](https://tio.run/##nVRRj9owDH7Pr8hpD3UgVVLgxI0sQtyhezpU6R76QtBEO7gVGJmAsYcrf32dUwoqSLBjieQ4/mzHsWwn/luS5Pmnb5NpupzQATzzJ/YMKXtP9XqYjrR@UjsS81Ql38er2ponagAv3AOPDeCVe8ydPe4Jd/a5Z4xjIu5FHnvcu4k1JIUvpnWz0Y07idZBEHTjeuDY9ucD13ooOKl2UNsMRwzS5Ybp9xf@yF@5o33eO/JRwfWR9nbqxzhdwoxv@ZwvWBFobavep3YFa70dBiO1Hi7q9dGdDqRiysnVXKccg0KpYoXmTAdtNfN9xdIp3MFmOMMI5r6eYbTN7sJvdpB7QObeMffdhjsaeG91Asbi1WQ8V7GefZHdn782LgaI66026wRqt8vznFKQjCKlSAlYQ4UFipQyQsFGliEUIUgoNVagpsNo7l9ZRFxZN4Bg2SUQpBEY4gVLjPjE9NQtfuDjAV37Zw7s@jZMXMTIv4whugydGxspGHx0E2A3bXrZ2J7rSlm9YSGBkP/7clF3tyTsNPehqFzLesVaR4qFnuHCGspEUfykBCMHl2iWYVIpPaK@/7Ws7j2a@VkVPV6vormU1oYhhiGMEZFToOeLlM1YkWAejajKSNmUVYkpGvPEz7lnKcPQ2kNScLn2N3s3xRggmBPjcoIvyv0IcEkp5sN@CJhDVsoxICUaSmkk8SFEzDKDn6YQYgdaJ7VO0@Lk@JNMF@O3de7//gs "C (gcc) – Try It Online") [(expanded)](https://tio.run/##nVRbb9owFH6Of8Wp9oANjuL0onZkaOpF3UurSNXEC0FTEgIE0rjKha4q/PVlxyalAQnWzpFO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pX/AZT5gmr91eOEAwe3TfjYooe1SEJXqK0nExIcZIZjTHYhb9qWkPHCwqOToaHHRs4TCHGNr0R/YMmNcwTsfg65PyC4j8cAIojH7jDMUkgl@ZXMRDPM68yFC18u3ADL3HXLGFjh1GDMxHeb2Tcgaoom2VU@wCRbmKop3rs5Yjjb8RwyHww9mTnw1z9KNCqDOxOUzV79yBqWmqKIYRj@gBLfpTZHEGpj43w5iqA7FPkP/EPLl8E11oyVlDcoaS48b@WGucXlZ@bB2CQZBF/gzJ1yW5afIM8Qj8JGlkXPUr5PMwjCLkhyNTqslVXen8MYgyVWWgm07VhHlP4SsIVumN6OHn4SEPTFsdyAq7pSxLAIo4zoAzodIDS1LAGRgBKnuSIdRDkAB40kJNhUFp7hnYhLvHB0Aq2S6QCg9pYjssMeMN0023WMD7E9pXZ0nZ/s9j1k6M/MuY9nZD28aesBh970co@9AHu43ltq4QzR02ErXE/0bWffcRwja5d63Gtu5X7HWcsdGXOLCHlpZuflKDPQXX6HKJpAKsUdP8WXd3hS7NZRNdb/eipRBSui6mYXme1VMKsD1IfRkbEuTRs5oyUl/KpsTTF3PDz7ZnIVxXyldScKjr71Vu9DNAkBNPcYIRRfUEKFL0@1A9At4rK/UzIAQaCuEJYlIXMck8LBqoizdQKqlUmhJfjj/hKPHHeWk@/QU "C (gcc) – Try It Online")
I wondered how bad a solution would be in a language without built-in pattern matching. It came out a lot smaller than I feared.
Basically, this approach breaks the gun down into a series of individual parts it expects to see in specific locations relative to a specific index. If all parts are found where they are expected, it's a gun! The bullet test increments a global counter to keep track of how many bullets were in it, which we print when we have found the one and only gun in the landscape.
*Note 1: I padded the test cases with spaces to ensure consistent row widths.*
*Note 2: Add 10 bytes if you don't like the [assign instead of return](https://codegolf.stackexchange.com/a/106067/71661) trick. For clarity, I used actual return statements in the expanded code.*
]