### 题解 #include<bits/stdc++.h>
#define Re register
#define fo(i, a, b) for (Re int i = (a); i <= (b); ++i)
#define fd(i, a, b) for (Re int i = (a); i >= (b); --i)
#define edge(i, u) for (Re int i = head[u], v = e[i].v; i; i = e[i].nxt, v = e[i].v)
#define pb push_back
#define F first
#define S second
#define ll long long
#define inf 1000000007
#define mp std::make_pair
#define mod 2000000007
#define eps 1e-4
#define lowbit(x) (x & -x)
#define N 1005
#define ls (u << 1)
#define rs (u << 1 | 1)
#define cl(arr) memset(arr, 0, sizeof arr)
{
x = 0;
Re char ch = getchar();
while (!isdigit(ch)) ch = getchar();
while (isdigit(ch)) x = (x << 3) + (x << 1) + ch - '0', ch = getchar();
}
int a[N][N], sumy[N], res, ans = inf, n;
bool flag = 0;
char s[N];
int main ()
{
Re char ch;

fo (i, 1, n)
{
scanf("%s", s + 1);
fo (j, 1, n)
{
//            ch = getchar();
//          while (ch != '#' && ch != '.') ch = getchar();
a[i][j] = (s[j] == '#');
sumy[j] += a[i][j];
flag |= a[i][j];
}
}

if (!flag) { printf("-1\n"); return 0; }
fo (i, 1, n) if (sumy[i] < n) ++res;
//    printf("%d", res);
fo (i, 1, n)
{
int now = res;
bool fl = sumy[i];
fo (j, 1, n)
if (!a[i][j]) ++now;
now += (!(bool)sumy[i]);
//        printf("%d ", now);
ans = std::min(ans, now);
}
printf("%d\n", ans);
return 0;
}
{"ft_lang_label":"__label__zh","ft_lang_prob":0.63450986,"math_prob":0.99975103,"size":2012,"snap":"2020-45-2020-50","text_gpt3_token_len":1246,"char_repetition_ratio":0.12151395,"word_repetition_ratio":0.044368602,"special_character_ratio":0.39214712,"punctuation_ratio":0.19211823,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9997794,"pos_list":[0,1,2],"im_url_duplicate_count":[null,4,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-10-29T08:42:20Z\",\"WARC-Record-ID\":\"<urn:uuid:9aca9da8-5a2e-40fa-9ab0-7fcce5cf6eba>\",\"Content-Length\":\"47724\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:d755ddd1-3542-4b84-a4ea-7672eeccc8f9>\",\"WARC-Concurrent-To\":\"<urn:uuid:7635b5cf-a2e2-480a-9d7c-409eac286c5b>\",\"WARC-IP-Address\":\"154.17.1.77\",\"WARC-Target-URI\":\"https://www.mina.moe/archives/12138\",\"WARC-Payload-Digest\":\"sha1:MQM6LWRSDNHTM2OYBD4OJG6LPEPSWIOA\",\"WARC-Block-Digest\":\"sha1:3GI56D367PQ2TBXXPRBCRZPONLOZIBVP\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-45/CC-MAIN-2020-45_segments_1603107903419.77_warc_CC-MAIN-20201029065424-20201029095424-00507.warc.gz\"}"}